Cod sursa(job #536369)
| Utilizator | Data | 18 februarie 2011 16:28:24 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include<string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
char s[1100000];
int i,nrl=0,nrc=0,n;
fin.get(s,1100000);
fin.get();
n=strlen(s);
if(isalpha(s[0]))nrl++;{
nrc++;}
for(i=0;i<n;i++){if(isalpha(s[i]))nrl++;
if(!isalpha(s[i-1]))nrc++;}
fout<<nrl/nrc;
} 