2012年3月23日

算法竞赛入门经典 1.2 变量及输入

摘要: //程序1-4 A+B问题(C语言) #include<stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); printf("%d\n",a+b); return 0; } //C++语言 #include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a+b<<endl; return 0; } //程序1-5 圆柱体的表面 阅读全文

posted @ 2012-03-23 22:13 1.曲待续 阅读(219) 评论(0) 推荐(0) 编辑

算法竞赛入门经典 1.1 算术表达式

摘要: //计算并输出1+2的值(C++) #include<iostream> using namespace std; int main() { cout<<1+2<<endl; //结果为3 return 0; } //计算并输出3-4的结果 #include<iostream> using namespace std; int main() { cout<<3-4<<endl; //结果为-1 return 0; } //计算并输出5X6的结果 #include<iostream> using namespac 阅读全文

posted @ 2012-03-23 22:12 1.曲待续 阅读(163) 评论(0) 推荐(0) 编辑

导航