Cod sursa(job #2609117)
Utilizator | Data | 2 mai 2020 10:54:15 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | igorj_mentorat1 | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream in;
ofstream out;
string s;
int nrc, nrl,i,j;
int main()
{
in.open("text.in");
out.open("text.out");
char ch;
int ok = 0;
while(in.get(ch))
{
if (isalpha(ch))
{
if (ok == 0)
{
ok = 1;
nrc++;
}
nrl++;
}
else
ok=0;
}
out << nrl/nrc;
}