码迷,mamicode.com
首页 >  
搜索关键字:scanf    ( 10388个结果
成绩等级
#include void main(){ /*方法一 int score; printf("请输入分数:\n") ; scanf("%d",&score); if (score>=90&&score=80) { printf("等级为B\n") ; } else if (sco...
分类:其他好文   时间:2014-08-14 23:09:46    阅读次数:137
输出星期
#include void main(){ int weekday; printf("请输入星期几:\n"); scanf("%d",&weekday); switch(weekday) { case 1: printf("星期一\n"); break; case 2: printf("...
分类:其他好文   时间:2014-08-14 23:07:16    阅读次数:231
输入日期计算天数
#include void main(){ int year,month,day,daynum; printf("请输入年月日,用,号隔开,格式列(2014,5,12)\n"); scanf("%d,%d,%d",&year,&month,&day); switch(month) { case...
分类:其他好文   时间:2014-08-14 23:06:48    阅读次数:276
书写一个程序,可以根据用户的选择,分别运算圆形、长方形、三角形的面积
#include #define PI 3.14 void main(){ int num; printf("请选择您要执行的操作:1.计算圆形面积2.长方形面积3.三角形面积\n"); scanf("%d",&num); switch (num) { c...
分类:其他好文   时间:2014-08-14 23:05:36    阅读次数:198
年龄判断
#include void main(){ int age; printf("请输入年龄:\n"); scanf("%d",&age); switch(age) { case 2: case 3: printf("孩子进入小班\n"); break; case 4: printf...
分类:其他好文   时间:2014-08-14 23:05:06    阅读次数:175
输入员工的销售额,自动计算出他的奖金
某企业员工奖金与员工的销售挂钩,其规则如下(超出部分):销售额 void main(){ double m,s,d; printf("请输入您的销售额:"); scanf("%lf",&s); if(s10&&s20&&s40&&s60&&s100) { d=1...
分类:其他好文   时间:2014-08-14 23:03:09    阅读次数:187
hdu 2025 查找最大元素
#include #include int main() { int i,len; char str[110],max; while(~scanf("%s",str)) { len=strlen(str); max='A'; for(i=0;imax) max=str...
分类:其他好文   时间:2014-08-14 20:47:39    阅读次数:262
hdu 2000 ASCII码排序
#include #include #include int cmp(const void *a,const void *b) { return *(char *)a-*(char *)b; } int main() { int i; char str[4]; while(~scanf("%s",str)) { qsort(str,3,sizeo...
分类:其他好文   时间:2014-08-14 20:46:00    阅读次数:177
hdu 2001 计算两点间的距离
开始WA,两点间距离公式竟然写错了,想死的心都有了。。。。 #include #include int main() { double x1,x2,y1,y2,m; while(~scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)) { m=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); p...
分类:其他好文   时间:2014-08-14 20:42:29    阅读次数:148
hdu 4950
#include int main(){ __int64 h,a,b,k,j=0; while(scanf("%I64d%I64d%I64d%I64d",&h,&a,&b,&k),h||a||b||k) { printf("Case #%I64d: ",++j); if(h<a+1) { printf("YES\n");...
分类:其他好文   时间:2014-08-14 20:42:19    阅读次数:230
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!