Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int ceve(char s[]){
- char *p;
- if(s[0]!='C'||s[1]!='V')
- return 0;
- p=strstr(s,".pdf");
- if(!(p!=NULL && strcmp(p,".pdf")==0))
- return 0;
- p=strtok(s,"_"); //p=CV
- if(p==NULL){
- return 0;
- }
- p=strtok(NULL,"_"); //p=prenume
- for(int i=0; i<strlen(p); i++){
- if(p[i]<'a'|| p[i]>'z')
- return 0;
- }
- p=strtok(NULL,"."); //p=nume
- if(p==NULL){
- return 0;
- }
- for(int i=0; i<strlen(p); i++){
- if(p[i]<'a'|| p[i]>'z')
- return 0;
- }
- return 1;
- }
- int main() {
- char s[100];
- cin.getline(s,100);
- cout<<ceve(s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement