个别代码摘自题中讨论或网络,如有侵权,私信修改删除。
2000-2100
2039
#include<stdio.h>
int main()
{
double a,b,c;//abc要求是正数,不要求是整数。
int n;
scanf("%d",&n);
while(n)
{
scanf("%lf%lf%lf",&a,&b,&c);
if(a+b>c&&a+c>b&&b+c>a)
printf("YES\n");
else
printf("NO\n");
n--;
}
return 0;
}
2101-2200
2201-2300
2301-2400
2401-2500
2501-2600
2601-2700
2629
#include<stdio.h>
char s[20];
void f(void)
{
int n;
n=(s[0]-'0')*10+(s[1]-'0');
switch(n)
{
case 33:
printf("Zhejiang,");break;
case 82:
printf("Macao,");break;
case 11:
printf("Beijing,");break;
case 54:
printf("Tibet,");break;
case 71:
printf("Taiwan,");break;
case 21:
printf("Liaoning,");break;
case 81:
printf("Hong Kong,");break;
case 31:
printf("Shanghai,");break;
}
}
int main()
{
int n;
scanf("%d",&n);
getchar(); //注意不可放入循环中
while(n--)
{
gets(s);
printf("He/She is from ");
f();
printf("and his/her birthday is on %c%c,%c%c,%c%c%c%c based on the table.\n",s[10],s[11],s[12],s[13],s[6],s[7],s[8],s[9]);
}
return 0;
}
2701-2800
2734
#include<stdio.h>
#include<string.h>
int main()
{
int a,i,l,sum=0;
char s[1000];
while(gets(s)!=NULL&&s[0]!='#')
{
l=strlen(s);
for(i=0;i<l;i++)
{
if(s[i]!=' ')
sum+=(s[i]-64)*(i+1);
}
printf("%d\n",sum);
sum=0;
}
return 0;
}