Cod sursa(job #1597915)
| Utilizator | Data | 12 februarie 2016 14:43:03 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.61 kb |
#include<fstream>
#include<string.h>
#define Max 15000
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int Lit, Cuv;
int main(){
char s[Max];
int i=0;
fin.getline(s,Max);
while(i<strlen(s)){
if(s[i]>='a' and s[i]<='z' or s[i]>='A' and s[i]<='Z')
Lit++;
i++;
}
i=0;
while(i<strlen(s)){
if(s[i]>='a' and s[i]<='z' or s[i]>='A' and s[i]<='Z' or s[i]=='-'){
Cuv++;
while(s[i]>='a' and s[i]<='z' or s[i]>='A' and s[i]<='Z' or s[i]=='-')
i++;
}
else i++;
}
}
