摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2393判断输入的几条边是否能组成一个直角三角形,但输入的数字中c不一定为最大,即斜边,需要先判断长短,或者在平方和中去判断也可以View Code 1 #include<iostream> 2 #include<stdlib.h> 3 using namespace std; 4 struct angle 5 { 6 double a; 7 double b; 8 double c; 9 };10 int main()11 {12 int n,i;13 angle g... 阅读全文
posted @ 2013-03-26 21:51 执着追求的IT小小鸟 阅读(136) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2055先打表,把各个字母对应的数值存起来,然后利用字符本身所有的ascii码值得到相应的数View Code 1 #include<stdio.h> 2 int main() 3 { 4 int f[200],y,i,n; 5 char a,s[2]; 6 for(i=65;i<91;i++) 7 f[i]=i-65+1; 8 for(i=97;i<123;i++) 9 f[i]=-(i-97+1);10 while(scanf("%d",&n)!=EOF) 阅读全文
posted @ 2013-03-26 20:51 执着追求的IT小小鸟 阅读(168) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int n,i; 6 char s[10000]; 7 while(scanf("%d",&n)!=EOF) 8 { 9 i=0;10 while(n/2)11 {12 s[i++]=n%2+'0';13 n/=2;14 }15 s[i++]=n+'0';16 for(i--;i>=0;i--)17 printf("%c",s[i]);18 ... 阅读全文
posted @ 2013-03-26 20:34 执着追求的IT小小鸟 阅读(173) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2025先求得最大的那个字符,然后一个一个对比,如果相等,就输出字符并输出(max),否则直接输出来就可以了View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int i,j,n; 6 char s[100000],x; 7 while(scanf("%s",s)!=EOF) 8 { 9 x=s[0];10 for(i=1;s[i]!='\0';i++)11 {12 阅读全文
posted @ 2013-03-26 20:26 执着追求的IT小小鸟 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2024在C语言程序设计中程序中使用的变量名、函数名、标号等统称为标识符。除库函数的函数名由系统定义外其余都由用户自定义。C规定标识符只能是字母(AZaz)、数字(09)、下划线(_)组成的字符串并且其第一个字符必须是字母或下划线。View Code 1 #include<stdio.h> 2 #include<string.h> 3 int pro(char *s) 4 { 5 int i,flag=0; 6 if((s[0]<'A'||(s[0] 阅读全文
posted @ 2013-03-26 20:15 执着追求的IT小小鸟 阅读(529) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1071一条抛物线跟一条直线围成一个图形,给出两个交点和曲线最高点的坐标,求出面积,自己退出各个公式的系数,然后定积分求出结果View Code 1 #include<stdio.h> 2 int main() 3 { 4 int t; 5 double x1,x2,x3,y1,y2,y3,a,b,c,k,h,s; 6 scanf("%d",&t); 7 while(t--) 8 { 9 scanf("%lf%lf",&x1,&y1); 阅读全文
posted @ 2013-03-26 19:54 执着追求的IT小小鸟 阅读(138) 评论(0) 推荐(0) 编辑