- 陶陶摘苹果
- 2010-03-28 11:57:00 @
#include
using namespace std;
int main(){
int a[11],t;
for (int i=1;i>a[i];
cin>>t;
t+=30;
int max=0;
for (int i=1;i
7 条评论
-
琉璃盏 LV 10 @ 2014-10-22 20:39:21
大神……orz。。。
-
2014-06-14 21:38:40@
只有十个苹果,你读了11个。
AC的代码:#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a[10],i,n;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
scanf("%d",&n);
int s=0;
for(i=0;i<10;i++)
if(n+30>=a[i]) s++;
printf("%d\n",s);
return 0;
}
-
2013-10-22 22:30:09@
记录信息
评测状态 Accepted
题目 P1102 陶陶摘苹果
递交时间 2013-10-22 22:29:37
代码语言 C++
评测机 上海红茶馆
消耗时间 15 ms
消耗内存 568 KiB
评测时间 2013-10-22 22:29:39评测结果
编译成功测试数据 #0: Accepted, time = 15 ms, mem = 560 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 564 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 568 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 560 KiB, score = 10
Accepted, time = 15 ms, mem = 568 KiB, score = 100
代码
#include <iostream>
using namespace std;
int main(){
int a[11],t;
for (int i=1;i<=10;i++) cin>>a[i];
cin>>t;
t+=30;
int max=0;
for (int i=1;i<=10;i++){
if (a[i]<=t)max+=1;
}
cout<<max;
} -
2013-07-21 20:59:08@
拜托,你没打return 0;编译器就会以为你的程序异常退出了=====
-
2013-05-27 13:39:16@
max变量重复。iostream里有max函数。
-
2013-02-09 11:03:10@
应该会CE 。变量i没声明
-
2013-01-31 19:12:31@
请使用fstream.h的文件格式
- 1