1 solutions
-
0
C :
#include<stdio.h> int main(){ int a[10],n,t=0,i; for(i=0;i<10;i++) scanf("%d",&a[i]); scanf("%d",&n); for(i=0;i<10;i++){ if(n+30>=a[i]) t++; } printf("%d",t); return 0; }C++ :
#include <iostream> #include <cmath> #include <cstring> using namespace std; int a[12],h,s=0; int main() { for (int i=1;i<=10;i++) cin>>a[i]; cin>>h; h+=30; for (int i=1;i<=10;i++) { if (h>=a[i]) s++; } cout<<s<<endl; // system ("pause"); return 0; }Pascal :
var x,y,z,i:longint; s:array[1..1000000] of longint; begin for i:=1 to 10 do read(s[i]); readln(x); y:=x+30; z:=0; for i:=1 to 10 do begin if s[i]>x then begin if s[i]<=y then z:=z+1 else z:=z; end else z:=z+1; end; writeln(z); end.
- 1
Information
- ID
- 18967
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By