C++ cout 未声明的标识符
/main_assignment.cpp#include<iostream>#include<stdio.h>#include"stdafx.h"#include<ost...
/ main_assignment.cpp
#include <iostream>
#include <stdio.h>
#include "stdafx.h"
#include <ostream>
#include <istream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
int main()
{
int a, b, c, d, e, f, g, x = 0, y = 100;
while (x < y);
a = 100000 + rand() % 899999;
b = rand() % 100;
c = rand() % 100;
d = rand() % 100;
e = rand() % 100;
f = rand() % 100;
g = rand() % 100;
cout << a << b << c << d << e << f << g << endl;
x = x++;
return 0;
} 展开
#include <iostream>
#include <stdio.h>
#include "stdafx.h"
#include <ostream>
#include <istream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
int main()
{
int a, b, c, d, e, f, g, x = 0, y = 100;
while (x < y);
a = 100000 + rand() % 899999;
b = rand() % 100;
c = rand() % 100;
d = rand() % 100;
e = rand() % 100;
f = rand() % 100;
g = rand() % 100;
cout << a << b << c << d << e << f << g << endl;
x = x++;
return 0;
} 展开
2个回答
展开全部
#include <iostream>
#include <stdio.h>
//#include "stdafx.h"
#include <ostream>
#include <istream>
#include <stdlib.h> //rand()函数声明所在头文件
using namespace std;
int main()
{
int a, b, c, d, e, f, g, x = 0, y = 100;
while (x < y){ //while花括号包括下面语句
a = 100000 + rand() % 899999;
b = rand() % 100;
c = rand() % 100;
d = rand() % 100;
e = rand() % 100;
f = rand() % 100;
g = rand() % 100;
cout << a <<" "<< b <<" "<< c <<" "<< d <<" "<< e <<" "<< f <<" "<< g << endl;
x++; //x自加就行了
}
return 0;
}
调试可行。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询