Cod sursa(job #652840)
Utilizator | avadani roxana roxi123 | Data | 26 decembrie 2011 15:54:12 |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include<string.h>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{char s[1000];
int nr=0,nr1=0,i;
f.get(s,1000);
for(i=0;i<=strlen(s);i++)
if(strchr("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",s[i])!=NULL)
nr++;
else
if(strchr("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",s[i-1])||strchr("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",s[i-2]))
nr1++;
g<<nr/nr1;
return 0;
}