Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- int duza(char a){
- char b='a';
- b=toupper(a);
- if (a==b){
- return 1;
- }
- else {
- return 0;
- }
- }
- int main() {
- FILE *f;
- FILE *fp;
- f=fopen ("lit.txt","r");
- if (f==NULL){
- printf("zly plik");
- }
- fp=fopen ("zapis.txt","w");
- char x;
- while(feof(f)==0){
- x=fgetc(f);
- if(duza(x)){
- x=tolower(x);
- }
- else{
- x=toupper(x);
- }
- fprintf(fp,"%c",x);
- printf("%c",x);
- }
- fclose (f);
- fclose (fp);
- }
- #include <stdlib.h>
- #include <stdio.h>
- int main(){
- FILE *fp;
- fp=fopen("zad.txt","r");
- int x=0;
- while(feof(fp)!=1){
- fgetc(fp);
- x++;
- printf("%c",fgetc(fp));
- }
- fclose(fp);
- printf("%d\n",x);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement