Cod sursa(job #536415)
| Utilizator | Data | 18 februarie 2011 17:16:57 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 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=1;i<n;i++){
if(isalpha(s[i]))nrl++;
if(!isalpha(s[i-1]))nrc++;
}
fout<<nrl/nrc;
return 0;
}
