453 条题解
-
0WBS LV 8 @ 2017-08-10 22:05:31
var i,x,ans:longint; a:array[1..10] of longint;
begin
for i:=1 to 10 do
read(a[i]);
readln(x);
for i:=1 to 10 do
if (x+30)>=a[i] then inc(ans);
writeln(ans);
end. -
02017-08-08 21:42:13@
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b[15],ans=0,i;
for(i=1;i<=10;i++)
{
scanf("%d",&b[i]);
}
scanf("%d",&a);
a=a+30;
for(i=1;i<=10;i++)
{
if(a>=b[i])
{
ans++;
}
}
printf("%d",ans);
} -
02017-08-08 21:42:02@
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b[15],ans=0,i;
for(i=1;i<=10;i++)
{
scanf("%d",&b[i]);
}
scanf("%d",&a);
a=a+30;
for(i=1;i<=10;i++)
{
if(a>=b[i])
{
ans++;
}
}
printf("%d",ans);
} -
02017-07-29 21:53:22@
#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
priority_queue<int,vector<int>,greater<int> > pq;
int n,x,sum=0;
for(int i=0;i<10;i++)
{
cin>>x;
pq.push(x);
}
cin>>x;
while(pq.size()>1)
{
if(x+30>=pq.top())
sum++;
else
break;
pq.pop();
}
cout<<sum;
return 0;
} -
02017-06-06 10:39:31@
算是比较简单的题了吧,用一个数组就能过了。
#include <iostream> using namespace std ; int main () { int total=0; int a[10]={0}; int max; cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]>>a[8]>>a[9]; cin>>max; for (int n=0;n<10;n++) { if (a[n]<=max+30) total++; } cout<<total; return 0; }
-
02017-05-14 14:25:16@
不难
#include<cstdio>
#include<iostream>
#include <algorithm>using namespace std;
int apple[15];
int main(){
for(int i = 1;i<11;i++){
cin >>apple[i];
}
int taotao;
cin >> taotao;
int counter = 0;
for(int i = 1;i < 11;i++){
if(taotao + 30 >= apple[i]){
counter++;
}
}
cout << counter << endl;
return 0;
} -
02017-05-13 09:10:01@
不用那么麻烦,直接用10个变量比较就行了,又简单又容易理解。
#include<iostream>
using namespace std;
int main()
{
int n,l=1,o,p,q,w,v,z=0,x,m,s,t,r,y,u,k;
int a,b,c,d,e,f,g,h,i,j;
cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j;
cin>>n;
n+=30;
while(l<=10)
{
if(a<=n){z++;a+=n;}
if(b<=n){z++;b+=n;}
if(c<=n){z++;c+=n;}
if(d<=n){z++;d+=n;}
if(e<=n){z++;e+=n;}
if(f<=n){z++;f+=n;}
if(g<=n){z++;g+=n;}
if(h<=n){z++;h+=n;}
if(i<=n){z++;i+=n;}
if(j<=n){z++;j+=n;}
l++;
}
cout<<z;
return 0;
} -
02017-04-10 10:39:16@
Python大法好
count = 0 n = raw_input() list = n.split(' ') t = raw_input() for nn in list: if int(t) + 30 >= int(nn): count += 1; print count
-
02017-03-10 20:34:52@
AC!!!GG!!!没毛病
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int s;
int l=0;
int a[11];
int i;
for(int i=1;i<=10;i++)
cin>>a[i];
cin>>s;
for(int i=1;i<=10;i++){
if(a[i]<=(s+30))
l++;}
cout<<l;
return 0;
} -
02017-03-10 19:08:27@
#include<iostream>
using namespace std;
int a[100];
int main()
{
int i,j,k=0,n;
for(i=0;i<10;i++)
cin>>a[i];
cin>>n;
for(i=0;i<10;i++)
{
if(a[i]<=(n+30))
k++;
}
cout<<k;
return 0;
} -
02017-02-16 09:52:02@
#include<iostream>
using namespace std;
int a[100];
int main()
{
int i,j,k=0,n;
for(i=0;i<10;i++)
cin>>a[i];
cin>>n;
for(i=0;i<10;i++)
{
if(a[i]<=(n+30))
k++;#include<iostream>
using namespace std;
int a[100];
int main()
{
int i,j,k=0,n;
for(i=0;i<10;i++)
cin>>a[i];
cin>>n;
for(i=0;i<10;i++)
{
if(a[i]<=(n+30))
k++;
}
cout<<k;
return 0;
}
}
cout<<k;
return 0;
} -
02016-12-18 19:06:38@
哈哈 这尼玛 这是我除了a+b第一道Ac的题 加油啊
-
02016-11-27 20:02:53@
c++短码,113bytes,欢迎挑战更短= =
c++
#include<iostream>
int a[11],s,i=11;int main(){while(i)std::cin>>a[--i];while(i<10)s+=a[++i]<*a+31;std::cout<<s;}
-
02016-11-24 15:13:38@
public class TestTT {
public static void main(String args[]){
int[] a=new int[10];
int n=0;for(int i=0,j=110;i<a.length;i++,j+=5){
a[i]=j;
int b=100;
if(a[i]>b){
b+=30;
}
if(a[i]<=b){
n++;
}}
System.out.println(n);
}}
-
02016-11-18 20:01:01@
思路:别考虑TT要不要板凳,直接上板凳大法就行了。
#include <iostream>
using namespace std;
int main()
{
int i,a[11],taotao,sum=0;
for(i=1;i<=10;i++)cin>>a[i];
cin>>taotao;
for(i=1;i<=10;i++)sum+=(taotao+30>=a[i]);
cout<<sum;return 0;
} -
02016-11-18 13:09:21@
#include<iostream>
#include<cstdio>
using namespace std;
int n;
int a[10000];
int main(){
int count=0;
for(int i=1;i<=10;i++){
scanf("%d",&a[i]);
}
scanf("%d",&n);
for(int i=1;i<=10;i++){
if(a[i]<=n+30){
count++;
}
}
cout<<count<<endl;
return 0;
} -
02016-11-16 16:35:35@
PROGRAM P1102; VAR HIGHAPPLE:ARRAY[1..10] OF INTEGER; HEIGHTP:INTEGER; I,NUM:INTEGER; BEGIN NUM:=0; FOR i:=1 TO 10 DO READ(HIGHAPPLE[I]); READLN; READ(HEIGHTP); FOR I:=1 TO 10 DO HIGHAPPLE[I]:=HIGHAPPLE[I]-30; FOR I:=1 TO 10 DO BEGIN IF HIGHAPPLE[I]<=HEIGHTP THEN INC(NUM); END; WRITE(NUM); END.
-
02016-11-10 19:12:17@
var pg:array[1..10] of integer; ts,i,gs:integer; begin for i:=1 to 9 do read(pg[i]); readln(pg[10]); readln(ts); for i:=1 to 10 do if (ts+30) >= pg[i] then inc(gs); writeln(gs); end.
-
02016-10-29 09:03:42@
#include<iostream>
using namespace std;
int A[105];int main()
{int a,b=0;
for(int i=0;i<10;i++)
cin>>A[i];
cin>>a;
for(int i=0;i<10;i++)
{
if(A[i]<=a+30)
b++;
}
cout<<b;
return 0;
} -
02016-10-24 16:21:12@
Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling foo.pas
foo.pas(11,24) Warning: Variable "s" does not seem to be initialized
Linking foo.exe
14 lines compiled, 0.0 sec, 27488 bytes code, 1268 bytes data
1 warning(s) issued
测试数据 #0: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 808 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 808 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 808 KiB, score = 10
测试数据 #6: Accepted, time = 15 ms, mem = 808 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 812 KiB, score = 10
Accepted, time = 15 ms, mem = 812 KiB, score = 100
返回代码界面 | 关闭
var a:array[1..10] of longint;
i,s,hand:longint;
begin
for i:=1 to 10 do
begin
read(a[i]);
end;
readln(hand);
for i:=1 to 10 do
begin
if hand >=a[i] then s:=s+1
else if (hand+30)>=a[i] then s:=s+1;
end;
writeln(s);
end.