1 solutions
-
0
C :
#include <stdio.h> int k; char c; int main(void) { scanf("%c",&c); while ( c != '\n' ) { if ( c > 'A' - 1 && c < 'Z' + 1 ) k++; scanf("%c",&c); } printf("%d\n",k); return 0; }C++ :
#include<iostream> #include<string> #include<cctype> using namespace std; void str(string); int main() { string line; getline(cin,line); str(line); return 0; } void str(string a) { int n,i; n=0; for(i=0;i<a.length();i++) { if(isupper(a[i])) n++; } cout<<n<<endl; }Pascal :
var st:string; i,s:longint; begin readln(st); for i:=length(st) downto 1 do if st[i] in ['A'..'Z'] then s:=s+1; writeln(s); end.6
- 1
Information
- ID
- 19374
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By