Cod sursa(job #2569769)
Utilizator | Data | 4 martie 2020 13:36:46 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
string s;
int i,lung=0,nr=0;
getline(f,s);
for(i=0;i<s.size();i++)
{
if(isalpha(s[i]))
lung++;
else
if(isalpha(s[i-1]))
nr++;
}
g<<lung/nr;
return 0;
}