2017年9月21日

摘要: 1 #include 2 using namespace std; 3 int main(){ 4 for(int a=1;a 20 using namespace std; 21 int main(){ 22 cout<<'*'<<'\n'; 23 cout<<'*'<<'*'<<'*'<<'\n'; 24 cout<<'*'<<'*'<<'*' 阅读全文

posted @ 2017-09-21 09:23 dragonliu欧美 阅读(133) 评论(0) 推荐(0) 编辑

摘要: 1 #include 2 using namespace std; 3 int main(){ 4 unsigned short a; 5 short int b=-2; 6 a=b; 7 cout<<"a="<<a<<endl; 8 return 0; 9 } 阅读全文

posted @ 2017-09-21 09:21 dragonliu欧美 阅读(147) 评论(0) 推荐(0) 编辑

摘要: 1 #include 2 using namespace std; 3 int main(){ 4 float x; 5 int i; 6 x=3.6; 7 i=(int)x; 8 cout<<"x="<<x<<",i="<<i<<endl; 9 return 0; 10 } 阅读全文

posted @ 2017-09-21 09:20 dragonliu欧美 阅读(76) 评论(0) 推荐(0) 编辑

摘要: 1 #include 2 using namespace std; 3 #define price 40 4 int main() { 5 int num,total; 6 num=10; 7 total=num*price; 8 cout<<"total="<<total<<endl; 9 return 0; 10 } 阅读全文

posted @ 2017-09-21 09:19 dragonliu欧美 阅读(75) 评论(0) 推荐(0) 编辑

摘要: 1 2 #include 3 using namespace std; 4 int main() { 5 char c1,c2; 6 c1='a'; 7 c2='b'; 8 c1=c1-32; 9 c2=c2-32; 10 cout<<c1<<'\n'<<c2<<endl; 11 return 0; 12 } 阅读全文

posted @ 2017-09-21 09:18 dragonliu欧美 阅读(61) 评论(0) 推荐(0) 编辑

摘要: 1 #include 2 using namespace std; 3 int main() { 4 int i,j; 5 i='A'; 6 j='B'; 7 cout<<i<<'\n'<<j; 8 return 0; 9 } 阅读全文

posted @ 2017-09-21 09:17 dragonliu欧美 阅读(78) 评论(0) 推荐(0) 编辑