Pagini recente » Cod sursa (job #2624889) | Cod sursa (job #1130054) | Cod sursa (job #1322022) | Cod sursa (job #312410) | Cod sursa (job #1597915)
#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++;
}
}