Cod sursa(job #3164067)
Utilizator | Data | 1 noiembrie 2023 23:12:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char s;
int nrl,nrc,spatiu;
nrl=nrc=spatiu=0;
while(fin.get(s))
{
if((s>='a' && s<='z')||(s>='A' && s<='Z'))
{
nrl++;
spatiu=1;
}
else if(spatiu==1)
{
nrc++;
spatiu=0;
}
}
fout<<nrl/nrc;
return 0;
}