Cod sursa(job #2441065)
Utilizator | Cretu Mihail-Dimosthenis dimos123 | Data | 19 iulie 2019 20:43:59 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char ch[100000];
int main()
{ int numar=0;
int i=1;
int ok=0;
int j=0;
f.getline(ch,100000);
if((ch[j]>='a' && ch[j]<='z') || (ch[j]>='A' && ch[j]<'Z'))
numar++,ok=1;
for(j=1;j<strlen(ch);j++)
{
if ((ch[j]>='a' && ch[j]<='z') || (ch[j]>='A' && ch[j]<'Z'))
numar++,ok=1;
else
{if(ok!=0)i++;
ok=0;}
}
g<<numar/(i-1);
return 0;
}