Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc,char *argv[]){
- FILE *fp;
- int i=0,j=0,k;
- fp=fopen(argv[1],"r");
- int sor,osz;
- fscanf(fp,"%d %d",&sor,&osz);
- char *s=calloc(sor*osz,sizeof(char));
- s[0]='\0';
- char c;
- while((c=fgetc(fp))!=EOF){
- if(c>='0' && c<='9'){
- printf("%d\n",j);
- sor=c-'0';
- fscanf(fp,"%d",&osz);
- s=calloc(sor*osz,sizeof(char));
- s[0]='\0';
- j=i=0;
- }
- if((c>='A') && (c<='Z')){
- j++;
- for(k=0;k<=i;k++){
- if(c==s[k]){
- j--;
- break;
- }
- }
- s[i]=c;
- i++;
- }
- }
- printf("%d\n",j);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement