#include <iostream>
using namespace std ;
int main(int argc, char **argv)
{
int nums[] {1,2,3,4,5,6,7,8};
int x{19};
double y{3.8},z{9.08};
string myStr1 {"hello"};
char myStr2[]{"world"};
for (char c:myStr1){
cout<<c<<endl;
}
for (auto c:myStr1){
cout<<c<<endl;
}
for (char c:myStr2){
cout<<c<<endl;
}
for(int x:nums){
cout<<x+10<<endl;
}
cout<<x<<endl<<y<<endl<<z<<endl;
cout<<"======"<<endl;
cout<<"X"<<hex<<x<<endl;//十六进制
cout<<dec<<x<<endl;//十进制
cout<<"0"<<oct<<x<<endl;//八进制
cout<<"======"<<endl;
cout<<"X"<<hex<<x<<endl<<dec<<x<<endl<<"0"<<oct<<x<<endl;
return 0;
}
h
e
l
l
o
h
e
l
l
o
w
o
r
l
d
11
12
13
14
15
16
17
18
19
3.8
9.08
======
X13
19
023
======
X13
19
023
Hit any key to continue...
来源:CSDN
作者:AI_LX
链接:https://blog.csdn.net/AI_LX/article/details/104125843