要求键盘输入角度和距离数据
123 30°
123 40°
123 50°
……
然后存入txt文档
距离 角度
123 30°
123 40°
123 50°
……
亲,望采纳!
#include <stdio.h>
#include <string.h>
char c[2][10010];
int main()
{
freopen("txt.txt", "w", stdout);
printf("距离 角度\n");
while(1)
{
scanf("%s %s", c[0], c[1]);
if(strcmp(c[0], "quit") == 0) break;
printf("%s %s\n", c[0], c[1]);
}
}