Cod sursa(job #855948)
| Utilizator | Data | 15 ianuarie 2013 20:40:22 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include<fstream>
#include<iostream>
#include<string.h>
#include<math.h>
using namespace std;
char s[100];
int main()
{
ifstream f("text.in");
ofstream g("text.out");
int cuv=0,lit=0,lungime=0;
f.getline(s,100);
lungime=strlen(s);
s[lungime]='.';
for(int i=0;i<=lungime;i++)
if(s[i]>='a'&&s[i]<='z' || s[i]>='A'&&s[i]<='Z')
{
lit++;
if((s[i+1]<'a' || s[i+1]>'z') && (s[i+1]<'A' || s[i+1]>'Z'))
cuv++;
}
g<<floor(lit/cuv);
return 0;
}
