Cod sursa(job #3032321)
Utilizator | Data | 21 martie 2023 22:16:40 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
const string file_name = "text";
ifstream fin(file_name + ".in");
ofstream fout(file_name + ".out");
string x;
int cuv, nmax;
int main()
{
getline(fin, x);
for(int i = 0; i < x.size(); i++){
//cout << x[i];
if(x[i] == ' '){
cuv++;
}
if(isalpha(x[i])){
nmax++;
}
}
cuv++;
fout << nmax / cuv;
return 0;
}