Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ne menuvaj ovde
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- void wtf() {
- FILE *f = fopen("log.txt", "w");
- char c;
- while((c = getchar()) != EOF) {
- fputc(c, f);
- }
- fclose(f);
- }
- int main() {
- wtf();
- FILE *f=fopen("log.txt", "r");
- char s[20];
- int count=0;
- while(fgets(s,20,f)!=NULL){
- int i, j=strlen(s), flag=0, bukvi=0, brojki=0, znaci=0;
- for(i=0;i<j;i++){
- if((s[i]>='0'&&s[i]<'9' ) || ( s[i]=='!' || s[i]=='@' || s[i]=='#' || s[i]=='$' || s[i]=='%' || s[i]=='%')){
- flag=1;
- }
- }
- if(isdigit(s[0])&&isdigit(s[1])&&isdigit(s[j-2])&&isdigit(s[j-3])&&isalpha(s[2])){
- count++;
- }
- if(!flag){
- count++;
- }
- for(i=0;i<j-1;i++){
- if((isalpha(s[i]))){
- bukvi=1;
- }
- if((isdigit(s[i]))){
- brojki=1;
- }
- if(!isdigit(s[i]) && !isalpha(s[i])){
- znaci++;
- }
- }
- if((bukvi>0)&&(brojki>0)&&(znaci>0)){
- count++;
- }
- }
- printf("%d", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement