任务
用C++输出以下内容:
int data = 100;
char *str = "hello world";
int a[] = {1,2,3,4,5,6,7};
- 1
- 2
- 3
代码块
复制 预览
用C++输出以下内容:
int data = 100;
char *str = "hello world";
int a[] = {1,2,3,4,5,6,7};
登录后即可发布作业,立即登录
我的作业
全部作业 100
#include <iostream>
using namespace std;
int main()
{
int data = 100;
cout << data << endl;
const char *str = "hello world";
cout << str << endl;
int a[] = {1,2,3,4,5,6,7};
int i = 0;
for(i = 0;i < sizeof(a) / sizeof(int);i++){
cout << a[i] << " ";
}
cout << endl;
return 0;
}