Cod sursa(job #1332905)
| Utilizator | Data | 2 februarie 2015 16:04:25 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <ctype.h>
#include <cstring>
using namespace std;
int main()
{
char c[100];int nc=0,lt=0,ls;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>c;ls=0;
if(isalpha(c[0]))nc++;
for(int i=0;i<strlen(c);i++)
if(isalpha(c[i])){lt++;ls++;}
}
lt-=ls;
cout<<lt<<' '<<nc;
g<<lt/nc;
return 0;
}
