摘要: #include<iostream> using namespace std; int main() { unsigned short a; short int b=-1; a=b; cout<<"a="<<a<<endl; return 0; } 阅读全文
posted @ 2017-09-13 13:08 TOTO2 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main() { float x; int i; x=3.6; i=(int)x; cout<<"x="<<x<<",i="<<i<<endl; return 0; } 阅读全文
posted @ 2017-09-13 13:02 TOTO2 阅读(137) 评论(1) 推荐(0) 编辑
摘要: #include using namespace std; #define PRICE 30 int main() { int num,total; num=10; total=num*PRICE; cout<<"total="<<total<<endl; return 0; } 阅读全文
posted @ 2017-09-13 12:56 TOTO2 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { char c1,c2; c1='a'; c2='b'; c1=c1-32; c2=c2-32; cout<<c1<<' '<<c2<<endl; return 0; } 阅读全文
posted @ 2017-09-13 12:48 TOTO2 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main() { int i,j; //i j是整形变量 i='A'; //将一个字符常量赋给整形变量i j='B'; //将一个字符常量赋给整形变量j cout<<i<<''<<j<<'\n'; return 阅读全文
posted @ 2017-09-13 12:35 TOTO2 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int i,j,m,n; i=8; j=10; m=++i+j++; n=(++i)+(++j)+m; cout<<i<<'\t'<<j<<'\t'<<m<<'\t'<<n<<endl; return 0; } 阅读全文
posted @ 2017-09-13 12:26 TOTO2 阅读(92) 评论(0) 推荐(0) 编辑