c语言图案问题,C语言绘图问题
該樓層疑似違規已被系統折疊?隱藏此樓查看此樓
這是我寫的程序,檢查無誤,但運行不了,不過我這水平也只能做到這份上了,求大神指教,以后我一定好好學習
#include
#include
#include
#include
void main()
{
int a,b,c,d,a2,b2,c2,d2;
char str[31];
FILE *fp;
fp=fopen("L1.txt","r");
if(fp==NULL)
printf("failed to open the file");
else
{
rewind(fp);//文件指針歸位
printf("現在光標:%x\n",fp->_ptr);//顯示當前光標所在位置
while(!feof(fp))
{
memset(str,0,31);//清理備用內存
fgets(str,31,fp);//獲取第一排數字
sscanf(str, "%d", a);
printf("%d\n",a);
fgets(str,31,fp);
sscanf(str,"%f",b);
printf("%f",b);
fgets(str,31,fp);
sscanf(str, "%f", c);
printf("%f\n",c);
fgets(str,31,fp);
sscanf(str,"%f",d);
printf("%f",d);
fgets(str,31,fp);//獲取第二排數字
sscanf(str, "%d", a2);
printf("%d\n",a2);
fgets(str,31,fp);
sscanf(str,"%f",b2);
printf("%f",b2);
fgets(str,31,fp);
sscanf(str, "%f", c2);
printf("%f\n",c2);
fgets(str,31,fp);
sscanf(str,"%f",d2);
printf("%f",d2);
moveto(a,b);
lineto(a2,b2);
}
fclose(fp);
system("pause");
}
}
總結
以上是生活随笔為你收集整理的c语言图案问题,C语言绘图问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++找出一个二维数组中的鞍点,即该位置
- 下一篇: c++折半查找算法