#include
int main(){
int i;
for(i=0;i<3;++i)
{
printf("I'm gonna WIN!\n");
}
return 0;
}
#include
int main(){
printf("I\n \nL\no\nv\ne\n \nG\nP\nL\nT\n");
return 0;
}
#include
int main(){
printf("************\n Welcome\n************");
return 0;
}
#include
int main(){
printf(" A\nA A\n A\n");
return 0;
}
#include
int main(){
printf("* * * *\n * * *\n * *\n *\n");
return 0;
}
#include
int main(){
int cm,foot,inch;
scanf("%d",&cm);
inch=(int)(cm*1.0/30.48*12)%12;
foot=(int)(cm*1.0/30.48*12)/12;
printf("%d %d",foot,inch);
return 0;
}
#include
int main(){
int F,C;
scanf("%d",&F);
printf("Celsius = %d",5*(F-32)/9);
return 0;
}
#include
int main(){
int H;
scanf("%d",&H);
double weight;
weight = (H-100)*0.9*2;
printf("%.1f",weight);
return 0;
}
#include
int main(){
int i,num=0,sum=0;
for(i=0;i<4;++i)
{
scanf("%d",&num);
sum+=num;
}
printf("Sum = %d; Average = %.1f",sum,sum*1.0/4.0);
return 0;
}
#include
int main(){
int a,b;
double c;
scanf("%d %d",&a,&b);
c=1.0*a/b;
if(a%b==0) printf("%d + %d = %d\n%d - %d = %d\n%d * %d = %d\n%d / %d = %d\n",a,b,a+b,a,b,a-b,a,b,a*b,a,b,(int)c);
else printf("%d + %d = %d\n%d - %d = %d\n%d * %d = %d\n%d / %d = %.2f\n",a,b,a+b,a,b,a-b,a,b,a*b,a,b,c);
return 0;
}
#include
int main(){
int math=87,eng=72,comp=93;
double average=0;
average=(math+eng+comp)*1.0/3;
printf("math = 87, eng = 72, comp = 93, average = %.0lf\n",average);
return 0;
}
#include
int main(){
int y,m,d;
scanf("%d-%d-%d",&m,&d,&y);
printf("%d-%02d-%02d",y,m,d);
return 0;
}
#include
int main(){
int day,result;
scanf("%d",&day);
if(day>=1&&day<=5)result=day+2;
else result=(day+2)%7;
printf("%d",result);
return 0;
}
#include
int main(){
int t1,perid,h1,m1,h2,m2,temp;
scanf("%d %d",&t1,&perid);
h1=t1/100;
m1=t1%100;
temp=h1*60+m1;
temp+=perid;
h2=temp/60;
m2=temp%60;
printf("%d%02d",h2,m2);//注意这里分钟保证为输出两字符用%02d表示
return 0;
}
#include
int main(){
int x,a,b;
scanf("%d",&x);
a=x/16;
b=x%16;
if(b>=10&&b<16)
{
a+=1;
b-=10;
}
printf("%d",a*10+b);
return 0;
}
#include
int main(){
int n,sign;
scanf("%d",&n);
if(n<0)
sign=-1;
else if(n==0)
sign=0;
else sign=1;
printf("sign(%d) = %d",n,sign);
return 0;
}
#include
int main(){
int scores;
char res;
scanf("%d",&scores);
if(scores>=90)res='A';
else if(scores>=80)res='B';
else if(scores>=70)res='C';
else if(scores>=60)res='D';
else res='E';
printf("%c",res);
return 0;
}
#include
int main()
{
double p, sum = 0;
int t;
scanf("%lf %d", &p, &t);
if (p <= 3)
sum += 10;
else if (p <= 10)
sum = 10 + (p - 3) * 2;
else
sum = 24 + (p - 10) * 3;
sum += (t / 5) * 2;
printf("%.0lf", sum);
return 0;
}
#include
int main()
{
int a[12]={
31,28,31,30,31,30,31,31,30,31,30,31};
int y,m,d,sum=0,i;
scanf("%d/%d/%d",&y,&m,&d);
for(i=0;i<m-1;++i)
sum+=a[i];
sum+=d;
if((y%4==0&&y%100!=0||y%400==0)&&m>2)
sum+=1;
printf("%d",sum);
return 0;
}
这是我的解法,相对复杂,推荐我解法后面的解法
#include
int main()
{
char ch[100];
scanf("%s",ch);
int i=0,res=0,flag=-1,sum,num1,num2,fh;
//num1与num2为操作数,sum为每个整数(用于计算超过两位数的数据),flag=-1则需要计算num1,flag=0则考虑符合,flag=1则计算num2
while(ch[i]!='=')
{
if(flag&&ch[i]>='0'&&ch[i]<='9')
{
sum=0;
while(ch[i]>='0'&&ch[i]<='9')
{
sum*=10;
sum+=ch[i]-'0';
++i;
}
if(flag==-1)
num1=sum;
else if(flag==1)
{
num2=sum;
switch (fh)
{
case 1:
num1=num1+num2;
break;
case 2:
num1=num1-num2;
break;
case 3:
num1=num1*num2;
break;
case 4:
if(num2)
num1=num1/num2;
else
flag=-100;
break;
}
}
if(flag==-100)
break;
flag=0;
}
if(flag==0&&ch[i]!='=')
{
switch (ch[i])
{
case '+':
fh=1;
break;
case '-':
fh=2;
break;
case '*':
fh=3;
break;
case '/':
fh=4;
break;
default :
flag=-100;
}
if(flag==-100)
{
break;
}
++i;
flag=1;
}
}
if(flag!=-100)
printf("%d",num1);
else
{
printf("ERROR");
}
return 0;
}
简单计算器 https://zhuanlan.zhihu.com/p/116734673
#include
int main()
{
int sum,a;
char c;
scanf("%d",&sum);
while(scanf("%c",&c))
{
switch(c)
{
case '+':scanf("%d",&a);sum+=a;break;
case '-':scanf("%d",&a);sum-=a;break;
case '*':scanf("%d",&a);sum*=a;break;
case '/':scanf("%d",&a);
if(a==0)
{
printf("error");
return 0;
}else{
sum/=a;break;
}
case '=':printf("%d",sum);return 0;
default :printf("error");return 0;
}
}
return 0;
}
#include
int main()
{
int v;
scanf("%d",&v);
if(v<=60)printf("Speed: %d - OK",v);
else printf("Speed: %d - Speeding",v);
return 0;
}
#include
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a==b)printf("C");
else if(a==c)printf("B");
else printf("A");
return 0;
}
#include
int main()
{
int x;double y;
scanf("%d",&x);
if(x<=15)y=4.0*x/3;
else y=2.5*x-17.5;
printf("%.2lf",y);
return 0;
}
#include
int main()
{
int sc,n,num,cnt=0;
scanf("%d %d",&sc,&n);
while(scanf("%d",&num),num>=0)
{
++cnt;
if(cnt>n)
break;
if(sc==num)
break;
else if(num>sc)
printf("Too big\n");
else if(num<sc)
printf("Too small\n");
}
if(cnt<=n&&sc==num)
{
if(cnt==1)
printf("Bingo!\n");
else if(cnt<=3)
printf("Lucky You!\n");
else
printf("Good Guess!\n");
}
else
{
printf("Game Over\n");
}
return 0;
}
#include
int main()
{
int sum=0,a;
scanf("%d",&a);
while(a>0)
{
if(a%2)
sum+=a;
scanf("%d",&a);
}
printf("%d",sum);
return 0;
}
#include
int main()
{
int a,b,ji;
scanf("%d %d",&a,&b);
ji=a*b;
while(a%b)
{
int temp;
temp=b;
b=a%b;
a=temp;
}
printf("%d %d",b,ji/b);
return 0;
}
#include
int main()
{
int N,fib[2]={
1,1},cnt=1;
scanf("%d",&N);
while(N>fib[(cnt-1)%2])
{
fib[(cnt-1)%2]=fib[0]+fib[1];
++cnt;
}
printf("%d",cnt);
return 0;
}
#include
int main()
{
int number,sum=0,count=0;
scanf("%d",&number);
while(number>0)
{
sum+=number%10;
count++;
number/=10;
}
printf("%d %d",count,sum);
return 0;
}
奇技淫巧
#include
int main()
{
int number,sum=0,count=0;
while(scanf("%1d",&number)!=EOF)
{
sum+=number;
count++;
}
printf("%d %d",count,sum);
return 0;
}
#include
double a3,a2,a1,a0;
double a,b;
double f(double x){
return a3*x*x*x+a2*x*x+a1*x+a0;
}
int main()
{
scanf("%lf %lf %lf %lf",&a3,&a2,&a1,&a0);
scanf("%lf %lf",&a,&b);
double temp=(a+b)/2;
int flag=f(a)>0?1:-1;
while(b-a>1e-4)
{
if(f(temp)==0)
break;
if(flag*f(temp)>0)
a=temp;
else if(flag*f(temp)<0)
b=temp;
temp = (a+b)/2;
}
printf("%.2lf",temp);
return 0;
}
#include
int main()
{
char ch;
int judge=0;
do
{
scanf("%c",&ch);
if(judge&&ch!='\n')printf(" ");
judge=1;
if(ch=='-')
printf("fu");
else
{
switch(ch)
{
case '0':printf("ling");break;
case '1':printf("yi");break;
case '2':printf("er");break;
case '3':printf("san");break;
case '4':printf("si");break;
case '5':printf("wu");break;
case '6':printf("liu");break;
case '7':printf("qi");break;
case '8':printf("ba");break;
case '9':printf("jiu");break;
}
}
}while(ch!='\n');
return 0;
}
#include
int main()
{
int N,sum,count=1;
scanf("%d",&N);
do{
sum=0;
int temp=N;
do{
sum+=temp%10;
temp/=10;
}while(temp);
if(N!=3*sum+1)
{
N=3*sum+1;
printf("%d:%d\n",count,N);
++count;
}
else
{
printf("%d:%d",count,N);
break;
}
}while(1);
return 0;
}
#include
int main()
{
double sum=1,k=-1.0;
int n,i;
scanf("%d",&n);
for(i=2;i<=n;++i)
{
sum+=k*i/(2*i-1);
k=-k;
}
printf("%.3lf",sum);
return 0;
}
#include
int main()
{
int m,n,i,j,num=0,sum=0;
scanf("%d %d",&m,&n);
if(m==0&&n==0)
printf("0 0");
else{
if(m==1)
++m;
for(i=m;i<=n;++i){
int count=0;
for(j=2;j<i;++j){
if(i%j==0)
count++;
}
if(count==0)
{
num++;
sum+=i;
}
}
}
printf("%d %d",num,sum);
return 0;
}
#include
int main()
{
long long n;
scanf("%lld",&n);
double a=2,b=1;
double sum=0;
for(long long i=0;i<n;++i)
{
sum+=(a*1.0)/b;
double tmp=a;
a=a+b;
b=tmp;
}
printf("%.2lf",sum);
return 0;
}
#include
int main()
{
int n;
scanf("%d",&n);
int num=1;
for(int i=0;i<n-1;++i)
{
num=(num+1)*2;
}
printf("%d",num);
return 0;
}
#include
int main()
{
int i=1,n;
while(1){
n=11*i+10;
if(n%7==4&&n%6==5&&n%5==1)
{
printf("%d",n);
break;
}
++i;
}
return 0;
}
奇技淫巧
#include
int main()
{
int n;
while(scanf("%1d",&n)!=EOF)
{
printf("%d ",n);
}
return 0;
}
#include
int main()
{
int y,f,n,flag=1;
scanf("%d",&n);
for(y=0;y<50;++y)
{
for(f=2*y+1;f<100;++f)
if(f*98-y*199==n)
{
printf("%d.%d",y,f);
flag=0;
break;
}
}
if(flag)
printf("No Solution");
return 0;
}
#include
int main()
{
int T,s;
scanf("%d",&T);
int t1=T/90,t2=T%90;
if(t2==0||t2==30||t2==45||t2==60)
{
printf("-_- %d",t1*270+t2*3);
}
else if((t2>0&&t2<30)||(t2>45&&t2<60))
{
printf("^_^ ");
if(t2<10)
printf("%d",t1*270+t2*9);
else if(t2<30)
printf("%d",t1*270+10*9);
else if(t2<50)
printf("%d",t1*270+135+(t2-45)*9);
else if(t2<60)
printf("%d",t1*270+180);
}
else
printf("@_@ %d",3*T);
return 0;
}
#include
int main()
{
int n;
int h,w;
double d;
scanf("%d",&n);
for(int i=0;i<n;++i)
{
scanf("%d %d",&h,&w);
d=(h-100)*0.9*2;
if( d>=w&&d-w < d*0.1 || d<w&&w-d < d*0.1 )
printf("You are wan mei!\n");
else if(w-d+d*0.1<1e-4)
printf("You are tai shou le!\n");
else if(w-d-1*d*0.1>-1e-4)
printf("You are tai pang le!\n");
}
return 0;
}
#include
int main()
{
int i,N,sum=0,jc=1;
scanf("%d",&N);
for(i=1;i<=N;++i)
{
jc*=i;
sum+=jc;
}
printf("%d",sum);
return 0;
}
#include
#include
int main()
{
int n,cnt=0,flag=1,num=1,t;
scanf("%d",&n);
while(1)
{
t=num/n;
if(flag&&t==0);
else
{
flag=0;
printf("%d",t);
}
++cnt;
if(num%n)
num=(num%n)*10+1;
else
{
printf(" %d",cnt);
break;
}
}
return 0;
}
奇技淫巧
#include
#include
int main()
{
int a[55],b[55],c[55];
for(int i=0;i<55;++i)
{
scanf("%d",&a[i]);
c[i]=b[i]=i;
}
char ch[54][4]={
"S1","S2","S3","S4","S5","S6","S7","S8","S9","S10","S11","S12","S13",
"H1","H2","H3","H4","H5","H6","H7","H8","H9","H10","H11","H12","H13",
"C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","C11","C12","C13",
"D1","D2","D3","D4","D5","D6","D7","D8","D9","D10","D11","D12","D13","J1","J2"};
for(int i=1;i<55;++i)
{
int pos=i;
for(int j=0;j<a[0];++j)
{
pos=a[pos];
}
b[pos]=i;
}
for(int j=1;j<55;++j)
{
if(j!=1)printf(" ");
printf("%s",ch[b[j]-1]);
}
return 0;
}
#include
int cha(int k,int *min,int *max){
int a[3],i,j;
for(i=0;i<3;++i)
{
a[i]=k%10;
k/=10;
}
for(i=3;i>0;--i)
{
for(j=0;j<i-1;++j)
{
if(a[j]>a[j+1])
{
int temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
*min=100*a[0]+10*a[1]+a[2];
*max=100*a[2]+10*a[1]+a[0];
int t=*max-*min;
return t;
}
int main(){
int k,min=0,max=0,res;
scanf("%d",&k);
int cnt=0;
if(k==495)
{
++cnt;
k=cha(k,&min,&max);
printf("%d: %d - %d = %d\n",cnt,max,min,k);
}
else
while(k!=495)
{
++cnt;
k=cha(k,&min,&max);
printf("%d: %d - %d = %d\n",cnt,max,min,k);
}
return 0;
}
#include
int wanshu(int num,int a[]){
int i,sum=0,j=0,flag=0;
for(i=1;i<num;++i){
if(num%i==0)
{
a[j]=i;
++j;
sum+=i;
}
}
if(sum==num)
flag=1;
return flag;
}
int main(){
int n,m,a[1500]={
0},i,j,cnt=0;
scanf("%d %d",&m,&n);
for(i=m;i<=n;++i)
{
if(wanshu(i,a))
{
++cnt;
printf("%d = ",i);
for(j=0;a[j]!=0;++j)
{
printf("%d",a[j]);
if(a[j+1]!=0)
printf(" + ");
}
printf("\n");
}
for(j=0;j<50;++j)
{
a[j]=0;
}
}
if(!cnt)
printf("None");
return 0;
}
#include
int main(){
int n,u,d,l=0,t=0;
scanf("%d %d %d",&n,&u,&d);
while(l<n)
{
l+=u;
t+=1;
if(l>=n)
break;
t+=1;
l-=d;
}
printf("%d",t);
return 0;
}
#include
int main(){
int n,cnt=0;
scanf("%d",&n);
if(n<0)printf("0");
else
{
while(n)
{
++cnt;
n/=2;
}
printf("%d",32-cnt);
}
return 0;
}
奇技淫巧
#include
int main(){
int m,n;
double res=1;
scanf("%d %d",&m,&n);
for(int i=0;i<m;++i)
{
res*=(n-i)*1.0/(m-i);
}
printf("result = %.lf",res);
return 0;
}
#include
#include
int main(){
char ch[21],res[22];
int a[10]={
0};
scanf("%s",ch);
int len=strlen(ch),flag=0,jw=0,t;
for(int i=len-1;i>=0;--i)
{
t=(ch[i]-'0')*2+jw;
jw=0;
if(t>9)
jw=1;
res[i+1]='0'+t%10;
++a[ch[i]-'0'];
}
if(jw==1)
{
res[0]='1';
++a[1];
}
else
{
res[0]='0';
flag=1;
}
++len;
for(int i=flag;i<len;++i)
{
--a[res[i]-'0'];
}
int jd=1;
for(int i=0;i<10;++i)
{
if(a[i])
{
jd=0;
break;
}
}
if(jd)
printf("Yes\n");
else
printf("No\n");
for(int i=flag;i<len;++i)
printf("%c",res[i]);
return 0;
}
#include
int main(){
int lower,upper;
double cel;
scanf("%d %d",&lower,&upper);
if(lower<=upper)
{
printf("fahr celsius\n");
for(int i=lower;i<=upper;i+=2)
{
cel=5.0*(i-32)/9;
printf("%d%6.1lf\n",i,cel);
}
}
else
{
printf("Invalid.");
}
return 0;
}
#include
int main(){
int n;
scanf("%d",&n);
double sum=0;
for(int i=0;i<n;++i)
{
sum+=1.0/(i*2+1);
}
printf("sum = %.6lf",sum);
return 0;
}
#include
int main(){
int n,k=1;
scanf("%d",&n);
double sum=0;
for(int i=0;i<n;++i)
{
sum+=1.0*k/(i*3+1);
k=-k;
}
printf("sum = %.3lf",sum);
return 0;
}
#include
int main(){
int n;
long long t=1;
scanf("%d",&n);
for(int i=0;i<=n;++i)
{
printf("pow(3,%d) = %lld\n",i,t);
t*=3;
}
return 0;
}
#include
int main(){
int n;
long long t=1,sum=0;
scanf("%d",&n);
for(int i=1;i<=n;++i)
{
t*=i;
sum+=t;
}
printf("%lld",sum);
return 0;
}
#include
int main(){
printf("[1] apple\n[2] pear\n[3] orange\n[4] grape\n[0] exit\n");
char ch[4][7]={
"apple","pear","orange","grape"};
double a[4]={
3.00,2.50,4.10,10.20};
int i,t;
for(i=0;i<5;++i)
{
scanf("%d",&t);
if(t==0)
break;
else
{
printf("price = %.2lf\n",a[t-1]);
}
}
return 0;
}
#include
int main(){
double x,sum;
scanf("%lf",&x);
int i=1,k=1;
while(1)
{
sum+=k*1.0/i;
if(1.0/i<=x)
break;
i+=3;
k=-k;
}
printf("sum = %.6lf",sum);
return 0;
}
#include
int main()
{
int n;
scanf("%d",&n);
double jc=1.0,sum=1;
for(int i=1;i<=n;++i)
{
jc/=i;
sum+=jc;
}
printf("%.8lf",sum);
return 0;
}
#include
int main()
{
double x,t,sum=1;
scanf("%lf",&x);
t=x;
int i=1;
while(t>=0.00001||t<=-0.00001)
{
sum+=t;
++i;
t*=x*1.0/i;
}
sum+=t;
printf("%.4lf",sum);
return 0;
}
#include
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<(n+1)/2;++i)
{
for(int j=n-2-i*2;j>=0;--j)
{
printf(" ");
}
for(int j=0;j<2*i+1;++j)
{
printf("* ");
}
printf("\n");
}
for(int i=0;i<n/2;++i)
{
for(int j=0;j<i+1;++j)
{
printf(" ");
}
for(int j=(n-i*2-2);j>0;--j)
{
printf("* ");
}
printf("\n");
}
return 0;
}
#include
int main()
{
printf("Welcome to You!");
return 0;
}
#include
int main()
{
printf("Programming in C is fun!");
return 0;
}
#include
int main()
{
printf("height = %.2lf",10.0*3*3/2);
return 0;
}
#include
int main()
{
int h,n,i;
scanf("%d %d",&h,&n);
double sum=h,t=h;
for(int i=0;i<n-1;++i)
{
sum+=t;
t/=2;
}
if(n)
printf("%.1lf %.1lf",sum,t/2);
else
printf("0.0 0.0");
}
#include
#include
int main()
{
int cnt=0,i;
char ch[81];
scanf("%[^\n]",ch);
int len=strlen(ch);
for(int i=0;i<=len;++i)
{
if(ch[i]>'A'&&ch[i]<='Z'&&ch[i]!='E'&&ch[i]!='O'&&ch[i]!='U'&&ch[i]!='I')
++cnt;
}
printf("%d",cnt);
return 0;
}
#include
#include
int main(){
char ch[81];
gets(ch);
int n = strlen(ch);
for(int i=0;i<n;++i){
if(ch[i]>='A'&&ch[i]<='Z'){
ch[i]='A'+(25-(ch[i]-'A'));
}
}
printf("%s",ch);
return 0;
}
#include
int main(){
int h,m,s;
scanf("%d:%d:%d",&h,&m,&s);
int n;
scanf("%d",&n);
int p,q,r,t,u;
p=(s+n)%60;
q=(s+n)/60;
r=(q+m)%60;
t=(q+m)/60;
u=(t+h)%24;
printf("%02d:%02d:%02d",u,r,p);
return 0;
}
#include
int main(){
printf("What is a computer?");
return 0;
}
#include
int main(){
int n;
scanf("%d",&n);
double sum=0;
for(int i=0;i<n;++i){
sum+=1.0/(i+1);
}
printf("sum = %lf",sum);
return 0;
}
#include
int main(){
int n;
scanf("%d",&n);
int count=0;
int total,remain;
int c=n/5;
for(int i=0;i<c;++i){
int k = c-i;
remain=n-k*5;
int d=remain/2;
for(int j=0;j<d;++j){
int p = d-j;
int remain1=remain-p*2;
if(!remain1)
continue;
printf("fen5:%d, fen2:%d, fen1:%d, total:%d\n",k,p,remain1,k+p+remain1);
++count;
}
}
printf("count = %d",count);
return 0;
}
#include
#include
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a+b<=c||a+c<=b||b+c<=a){
printf("These sides do not correspond to a valid triangle");
}
else{
double s = (a+b+c)/2.0;
double area = sqrt(s*(s-a)*(s-b)*(s-c)),cir = a+b+c;
printf("area = %.2lf; perimeter = %.2lf",area,cir);
}
return 0;
}
#include
int main(){
int m,n;
double sum=0;
scanf("%d %d",&m,&n);
for(int i=m;i<=n;++i){
sum+=i*i+1.0/i;
}
printf("sum = %lf",sum);
return 0;
}
#include
int main(){
int n;
scanf("%d",&n);
if(n%5<=3&&n%5){
printf("Fishing in day %d",n);
}
else{
printf("Drying in day %d",n);
}
}
#include
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a>b){
int tmp = a;
a=b;
b=tmp;
}
if(a>c){
int tmp=c;
c=b;
b=a;
a=tmp;
}
if(b>c){
int tmp=b;
b=c;
c=tmp;
}
printf("%d->%d->%d",a,b,c);
}
#include
#include
int main()
{
double a,b,c,x1,y1,x2,y2,x3,y3,A,p;
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
c=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
if (a+b<=c || b+c<=a || a+c<=b)
{
printf("Impossible");
}
else
{
p=(a+b+c)/2;
A=sqrt(p*(p-a)*(p-b)*(p-c));
printf("L = %.2f, A = %.2f",2*p,A);
}
return 0;
}
#include
int main(){
printf("152 = %d + %d*10 + %d*100",152%10,152/10%10,152/100);
return 0;
}
#include
int main(){
double x;
scanf("%lf",&x);
if(x>10-1e-6&&x<10+1e-6){
printf("f(%.1lf) = %.1lf",x,1.0/x);
}else{
printf("f(%.1lf) = %.1lf",x,x);
}
return 0;
}
#include
int main(){
int sum = 0;
for(int i=1;i<101;++i){
sum+=i;
}
printf("sum = %d",sum);
return 0;
}
#include
int main(){
int a,b;
char c;
scanf("%d %d %c",&a,&b,&c);
double discount = c=='m'?0.95:0.97;
double price = b==90?6.95:b==93?7.44:7.93;
double sum = a * price *discount;
printf("%.2lf",sum);
return 0;
}