摘要: Problem AEcological PremiumInput:standard inputOutput:standard outputTime Limit:1 secondMemory Limit:32 MBGerman farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meters an 阅读全文
posted @ 2014-01-28 21:32 七彩蝶 阅读(253) 评论(0) 推荐(0)
摘要: Problem BBack to High School PhysicsInput:standard inputOutput:standard outputA particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?InputThe input will contain two integers in each line. Each line m 阅读全文
posted @ 2014-01-28 17:37 七彩蝶 阅读(188) 评论(0) 推荐(0)
摘要: Problem AHashmat the brave warriorInput:standard inputOutput:standard outputHashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the 阅读全文
posted @ 2014-01-28 16:22 七彩蝶 阅读(155) 评论(0) 推荐(0)
摘要: 第三章习题/*分数统计 输入一些学生的分数,哪个分数出现的次数最多?如果有多个并列,从小到大输出。 任务1:分数均为不超过100的非负整数 任务2:分数均为不超过100的非负实数,但最多保留两位小数。*/ 1 #include 2 #include 3 using namespace std; 4 #define MAXN 100 5 int main() 6 { 7 int a[MAXN],i,j,len = 0,most[MAXN] = {0},b[MAXN],tmp,k; 8 while(cin >> a[len] && len 0);i ++)10 {/.. 阅读全文
posted @ 2014-01-24 21:54 七彩蝶 阅读(417) 评论(0) 推荐(0)
摘要: 第二章习题/*位数 输入一个不超过10^9的正整数,输出它的位数。例如12735的位数是5.请不要使用任何数学函数,只用四则运算和循环语句实现。*/ 1 #include 2 int main() 3 { 4 FILE *fin,*fout; 5 fin = fopen("data.i... 阅读全文
posted @ 2014-01-20 13:20 七彩蝶 阅读(286) 评论(0) 推荐(0)
摘要: 第一章习题/*平均数 输入3个整数,输出它们的平均值,保留3位小数。*/ 1 #include 2 int main() 3 { 4 int a,b,c; 5 double aver; 6 scanf("%d%d%d",&a,&b,&c); 7 aver = (a + b + c) / 3; 8 printf("%.3lf\n",aver); 9 10 return 0;11 }/*温度 输入华氏温度f,输出对应的摄氏温度c,保留3位小数。提示:c=5(f-32)/9.*/1 #include 2 int main()3 {4 . 阅读全文
posted @ 2014-01-19 12:34 七彩蝶 阅读(351) 评论(0) 推荐(0)