宝典中题目,代码进入死循环,但没看懂,
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/13 19:32:35
宝典中题目,代码进入死循环,但没看懂,
#include using namespace std; #define MAX 255 main() { char p[MAX+1]; char ch; for (ch=0;ch
#include using namespace std; #define MAX 255 main() { char p[MAX+1]; char ch; for (ch=0;ch
把ch的定义换成unsigned char
#include<iostream>
using namespace std;
#define MAX 255
main()
{
char p[MAX+1];
unsigned char ch;
for (ch=0;ch<MAX;ch++) {
p[ch]=ch;
cout<<ch<<" ";}
cout<<ch<<" ";
}
#include<iostream>
using namespace std;
#define MAX 255
main()
{
char p[MAX+1];
unsigned char ch;
for (ch=0;ch<MAX;ch++) {
p[ch]=ch;
cout<<ch<<" ";}
cout<<ch<<" ";
}