Cod sursa(job #2623)
Utilizator | Tudor Pop tudorpop22 | Data | 18 decembrie 2006 14:45:51 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.57 kb |
#include<fstream>
#include<string>
using namespace std;
char s[5050], p[5050];
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char sep[]={"- "};
char *t;
int cuv=0 , lit=0,i , pp;
fin.get(s,5000);
t=strtok(s,sep);
while(t)
{
t=strupr(t);
for(i=0;i<strlen(t);i++)
if('A'<=t[i] && t[i]<='Z')
{ cuv++;
break;
}
for(i=0;i<strlen(t);i++)
if('A'<=t[i] && t[i]<='Z')
lit++;
t=strtok(NULL,sep);
}
int med;
med=lit/cuv;
fout<<med;
fout.close();
return 0;
}