1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; string s; int n,t,y; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>s; if(s[0]>='A'&&s[0]<='G'||s[0]>='R'&&s[0]<='T')t++; } y=n-t; cout<<y; return 0; }
Pascal :
var n,t,i:longint; s,p:string; begin readln(n); t:=0; for i:=1 to n do begin readln(s); p:=copy(s,1,1); if (p='A')or(p='B')or (p='C')or (p='D')or (p='E') or (p='F')or(p='G') or (p='R')or(p='S') or (p='T') then inc(t); end; writeln(n-t); end.
Information
- ID
- 796
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 9
- Tags
- # Submissions
- 11
- Accepted
- 4
- Uploaded By