Cod sursa(job #1429188)
Utilizator | Data | 5 mai 2015 20:19:11 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.68 kb |
#include <iostream>
#include <fstream>
#include <cctype>
#include <string.h>
using namespace std;
//#define FOR(i,a,b) for(i=a;b<=b;i++)
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char sir[1000000];
f.get(sir,100000001);
int ok=0;
int lung = strlen(sir);
int contor1=0;
int contor2=0;
for(int i = 0 ; i <=lung ;i ++ )
{
if(isalpha(sir[i]))
{contor1++;
if(ok==1)
contor2++;
ok=0;
}
else
{ok=1;
}
}
if(contor2 == 0)
g<<contor1;
else
g<<contor1/contor2;
}