#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define I 20
#define R 340
#include <string.h>
int main()
{
char answer[10];
printf("遇到你\n我才发现\n曾经所有的条件\n似乎都成了我等你的借口\n\n");
printf("请允许我,从今往后映入你\n明媚的眼\n");
printf("输入yes或no,点击Enter");
printf("\n ");
scanf("%s", answer);
char b[4]="yes";
if(strcmp(answer,b)==0)
{
float y, x, z, f;
for (y = 1.5f; y > -1.5f; y -= 0.1f)
{
for (x = -1.5f; x < 1.5f; x += 0.05f)
{
z = x * x + y * y - 1;
f = z * zz - x * xyyy;
putchar(f <= 0.0f ? "*********"[(int)(f*-8.0f)] : ' ');
}
putchar('\n');
}
long time;
for (;;)
{
system("color a");
for (time = 0; time<99999999; time++);
system("color b");
for (time = 0; time<99999999; time++);
system("color c");
for (time = 0; time<99999999; time++);
system("color d");
for (time = 0; time<99999999; time++);
system("color e");
for (time = 0; time<99999999; time++);
system("color f");
for (time = 0; time<99999999; time++);
system("color 0");
return 0;}
为什么最后一行总是显示错误啊
最后一行总是显示错误,有没有人能告诉我
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
关注 error:stray'\243'in program
错误原因:
出现非标ASCII的字符,比如全角的{,},;
我们还少打了三个}
还有变量没有声明
下面这个去把zz和xyyy申明了应该就可以了,有不懂的欢迎随时来问#include <stdio.h> #include <math.h> #include <stdlib.h> #define I 20 #define R 340 #include <string.h> int main() { char answer[10]; printf("遇到你\n我才发现\n曾经所有的条件\n似乎都成了我等你的借口\n\n"); printf("请允许我,从今往后映入你\n明媚的眼\n"); printf("输入yes或no,点击Enter"); printf("\n "); scanf("%s", answer); char b[4]="yes"; if(strcmp(answer,b)==0) { float y, x, z, f; for (y = 1.5f; y > -1.5f; y -= 0.1f) { for (x = -1.5f; x < 1.5f; x += 0.05f) { z = x * x + y * y - 1; f = z * zz - x * xyyy; } putchar('\n'); } long time; for (;;) { system("color a"); for (time = 0; time<99999999; time++); system("color b"); for (time = 0; time<99999999; time++); system("color c"); for (time = 0; time<99999999; time++); system("color d"); for (time = 0; time<99999999; time++); system("color e"); for (time = 0; time<99999999; time++); system("color f"); for (time = 0; time<99999999; time++); system("color 0"); return 0; } } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用
悬赏问题
- ¥15 单片机学习顺序问题!!
- ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
- ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
- ¥15 相敏解调 matlab
- ¥15 求lingo代码和思路
- ¥15 公交车和无人机协同运输
- ¥15 stm32代码移植没反应
- ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
- ¥100 连续两帧图像高速减法
- ¥15 如何绘制动力学系统的相图