^`
格式:一题号一答案,相对应
1001
#include "stdio.h"
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
}
1007
#include "stdio.h"
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
}
1014
#include"stdio.h"
void main()
{
float area,r;
scanf("%f",&r);
area=3.14159*r*r;
printf("%0.2f",area);
}
1015
#include
void main()
{float f,c;
scanf("%f",&f);
c=5.0/9*(f-32);
printf("%.2f",c);
}
1016
#include
main()
{char a,b,c,d,e;
scanf("%c%c%c%c%c",&a,&b,&c,&d,&e);
if(a<=Z&&a>=A)a=a+32;
if(b<=Z&&b>=A)b=b+32;
if(c<=Z&&c>=A)c=c+32;
if(d<=Z&&d>=A)d=d+32;
if(e<=Z&&e>=A)e=e+32;
printf("%c%c%c%c%c",a,b,c,d,e);
}
1017
#include "stdio.h"
void main()
{int n,place;
scanf("%ld",&n);
if(n>99999999)place=9;
else if(n>9999999)place=8;
else if(n>999999)place=7;
else if(n>99999)place=6;
else if(n>9999)place=5;
else if(n>999)place=4;
else if(n>99)place=3;
else if(n>9)place=2;
else place=1;
printf("%ld\n",place);
}
1018
#include
main()
{int a,b,c,t;
scanf("%d,%d,%d",&a,&b,&c);
if(a>b){t=a;a=b;b=t;}
if(a>c){t=a;a=c;c=t;}
if(b>c){t=b;b=c;c=t;}
printf("%d,%d,%d",a,b,c);
}
1019
#include"stdio.h"
main()
{int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
if(a%27==0)printf("YES\n");else printf("NO\n");
if(b%27==0)printf("YES\n");else printf("NO\n");
if(c%27==0)printf("YES\n");else printf("NO\n");
if(d%27==0)printf("YES\n");else printf("NO\n");
if(e%27==0)printf("YES\n");else printf("NO\n");
}
1020
#include"stdio.h"
main()
{int n;
scanf("%d",&n);
if(n<0)printf("negative\n");
else printf("positive\n");
if(n%2==0)printf("even\n");
else printf("odd\n");
}
1023
#include
int main()
{float a,b,c;
char op;
scanf("%f%c%f",&a,&op,&b);
switch(op)
{case+:c=a+b;break;
case-:c=a-b;break;
case*:c=a*b;break;
case/:c=a/b;break;
default:printf("error");
break;
}
printf("result=%.2f",c);
}
1024
#include
void main()
{long i,n=1,a;
scanf("%ld",&a);
for(i=1;i<=a;i++)n=n*i;
printf("%ld\n",n);
}
1025
#include
void main()
{long n,sum=0,i,t=1;
scanf("%ld",&n);
for(i=1;i<=n;i++)
{sum=sum+t;
t=t+2;
}
printf("%ld\n",sum);
}
1026
#include
void main()
{char c;
int s=0,a;
while((c=getchar())!=\n)
{if(c>=0&&c<=9)
{a=c-48;
s=s+a;
}
}
printf("%d",s);
}
1028
#include
#include
main()
{int m,k,i;
for(m=2;m<=200;m++)
{k=sqrt(m);
for(i=2;i<=k;i++)
if(m%i==0)break;
if(i>k)printf("%d\n",m);
}
}
1029
#include
void main()
{long r,m,n;
scanf("%ld,%ld",&m,&n);
while(m!=0)
{r=n%m;
n=m;
m=r;
}
printf("%ld\n",n);
}
1030
#include
void main()
{char c;
while((c=getchar())!=\n)
{if(c>=A&&c<=Z)
c=c+32;
putchar(c);
}
}
1031
#include
void main()
{int i,num=0,word=0;
char c;
for(i=0;(c=getchar())!=\n;i++)
if(c== )word=0;
else if(word==0)
{word=1;
num++;
}
printf("%d",num);
}
1035
#include"stdio.h"
#include"math.h"
void main()
{int n,i,j,k;
scanf("%d",&n);
for(i=1;i<=2*n+1;i++)
{k=abs(n+1-i);
for(j=1;j<=k;j++)printf("");
for(j=1;j<=2*n+1-2*k;j++)printf("*");
printf("\n");
}
}
1037
#include
main()
{int i,t,n;
float a=2,b=1,s=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{s=s+a/b;
t=a;a=a+b;b=t;
}
printf("%.4f\n",s);
}
1038
#include
#include
main()
{int n,i,j,k,h;
scanf("%d",&n);
for(i=-n+1;i<=n-1;i++)
{for(j=0;j=1;h--)printf("%d",h);
printf("\n");
}
}
1039
#include
main()
{int a[10];
int i;
for(i=0;i<10;i++)scanf("%d",&a[i]);
for(i=9;i>=0;i--)printf("%d\n",a[i]);
}
1040
#include"stdio.h"
main()
{int a[20];
int i,t,p=0;
for(i=0;i<20;i++)
{scanf("%d",&a[i]);
for(t=0;t
#include
void main()
{int m,i;
scanf("%d",&m);
for(i=1;i<=38;i++)
if(0.01*(pow(2,i-1)-1)-i*m>=0)break;
printf("%d",i-1);
}
1044
#include"stdio.h"
main()
{int i,t,min;
scanf("%d",&min);
for(i=1;i<10;i++)
{
scanf("%d",&t);
if(t=0;i--)a[n1-1-i]=s[i]-0;
gets(s);
n2=strlen(s);
for(i=n2-1;i>=0;i--)b[n2-1-i]=s[i]-0;
if(n1>n2)max=n1;
else max=n2;
for(i=0;i<=max;i++)
{c[i]=(a[i]+b[i]+e)%10;
e=(a[i]+b[i]+e)/10;
}
if(c[max]>0)printf("%d",c[max]);
for(i=max-1;i>=0;i--)
printf("%d",c[i]);
}
1047
#include
main()
{int a[10];
int i,j,t;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<9;i++)
{for(j=0;j<9-i;j++)
if(a[j]>a[j+1])
{t=a[j];a[j]=a[j+1];a[j+1]=t;}
}
for(i=0;i<10;i++)
printf("%d",a[i]);
}
1050
#include"stdio.h"
main()
{int i,j;
char a[80],b[80];
gets(a);gets(b);
for(i=0;a[i]!=\0;i++)
{for(j=0;b[j]!=\0;j++)
if(a[i+j]!=b[j])break;
if(b[j]==\0)break;
}
if(a[i]!=\0)printf("%d",i+1);
else printf("Not Found");
}
1051
#include
main()
{int i,j,k,a[3][4],max,maxj,flag;
for(i=0;i<3;i++)
for(j=0;j<4;j++)
scanf("%d",&a[i][j]);
for(i=0;i<3;i++)
{max=a[i][0];
maxj=0;
for(j=0;j<4;j++)
if(a[i][j]>max)
{max=a[i][j];maxj=j;}
flag=1;
for(k=0;k<3;k++)
if(max>a[k][maxj])
{flag=0;break;}
if(flag)
{printf("%d",max);break;}
}
if(!flag)
printf("NO");
}
1059
#include"stdio.h"
int f(int m,int n)
{
int r;
while((r=m%n)!=0)
{
m=n;
n=r;
}
return n;
}
main()
{
int a,b,n;
scanf("%d%d",&a,&b);
printf("%d\n",f(a,b));
}
1062
#include
void main()
{int a[3][4],b[4][3],i,j;
for(i=0;i<3;i++)
for(j=0;j<4;j++)
{scanf("%d",&a[i][j]);
b[j][i]=a[i][j];
}
for(i=0;i<4;i++)
{for(j=0;j<3;j++)
printf("%d",b[i][j]);
printf("\n");
}
}
1065
#include"stdio.h"
main()
{printf("19\n");
printf("2016\n");
printf("2000\n");
printf("2016\n");
printf("2004\n");
printf("2016\n");
printf("2036\n");
printf("2020\n");
printf("21");
}
1083
long fanc(int a)
{long i,n=1;
for(i=1;i<=a;i++)n=n*i;
return n;
}
void main()
{int n;
scanf("%d",&n);
printf("%ld",fanc(n));
}
1084
#include"stdio.h"
void fun(int i)
{if(i>1)
fun(i/2);
printf("%d",i%2);
}
main()
{int n;
scanf("%d",&n);
fun(n);
}
1091
#include"stdio.h"
void swap(int*p1,int*p2)
{int temp;
temp=*p1;
*p1=*p2;
*p2=temp;
}
int main()
{int a,b;int*pa,*pb;
scanf("%d%d",&a,&b);
pa=&a;pb=&b;
if(a
int main(void)
{
int val;
int m,sum=0;
printf("请输入数字:");
scanf("%d",&val);
m=val;
while(m)
{
sum=sum*10+m%10;
m/=10;
}
if(val==sum)
printf("Y\n");
else
printf("N\n");
return 0;
}
6567
#include "stdio.h"
main()
{
printf("The first C Program\n");
}
6568
#include
main()
{
printf("C:\\ABC.TXT");
}
11126
#include
int max(int x,int y)
{
if(x>y)return x;
else return y;
}
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",max(a,b));
}
结束!资源提供出处http://l1183238717.190.2008106.com/bbs2/bbs2/forum.php