c语言字符动画如何设计?
准备很多txt文件,一帧一帧的连续打印出来,可是通过C语言运用输出时图像像是扫描上去的,无法实现动作连续,怎么办?
#include <stdio.h> #include<stdlib.h> void main() { int i; for(i=0;i<18;i++) {FILE *fp; char ch; if((fp=fopen("g:\\c语言\\Badapple\\badapple\\新建文件夹\\i.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); } system("cls"); }
#include <stdio.h> #include<stdlib.h> void main() { int i; { i=1; FILE *fp; char ch; if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\1.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\2.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\3.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\4.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\5.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\6.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\7.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\8.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\9.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\10.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\11.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\12.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\13.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); system("cls"); if((fp=fopen("j:\\c语言\\Badapple\\badapple\\新建文件夹\\14.txt","r+"))==NULL) { printf("cannot open the file!"); exit(0); } ch=fgetc(fp); while(ch!=EOF) { putchar(ch); ch=fgetc(fp); } fclose(fp); } system("cls"); }