Mai intai trebuie sa te autentifici.
Cod sursa(job #2695475)
Utilizator | Data | 13 ianuarie 2021 11:15:51 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.62 kb |
#include <fstream>
#include <algorithm>
#include <ctype.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
int nrl=0,nrc=0;
string s;
getline(in,s);
bool cuvant=false;
for(int i=0;i<=s.size();i++)
{
char c=s[i];
if(isalpha(c))
{
nrl++;
cuvant=true;
}
else
{
if(cuvant==true)
{
nrc++;
}
cuvant=false;
}
}
if(cuvant==true)
{
nrc++;
}
out<<nrl/nrc;
return 0;
}