jal il y a 5 ans
Parent
commit
47ff83ffb4
1 fichiers modifiés avec 17 ajouts et 0 suppressions
  1. 17 0
      C.cpp

+ 17 - 0
C.cpp

@@ -0,0 +1,17 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+int main(){
+	string s;
+	while(getline(cin, s)){
+		int a = 0, b = 0, c = 0, d = 0;
+		for(int i = 0; i < s.size(); i++){
+			if(isalpha(s[i]))a++;
+			else if(isspace(s[i]))b++;
+			else if(isdigit(s[i]))c++;
+			else d++;
+		}
+		cout << a << " " << c << " " << b << " " << d << endl;
+	}
+	return 0;
+}