随笔分类 -  POJ水题记录

摘要:题目描述:计算a+b输入:两个整数a,b(0<=a,b<=10)输出:输出a+b样例输入:1 2样例输出:3样例代码:#include <iostream>using namespace std;int main(){ int a,b; cin>>a>>b; cout<<a+b<<endl; return 0;}题目来源:http://poj.org/problem?id=1000 阅读全文
posted @ 2012-05-21 11:36 Pengchao Bai 阅读(187) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=1488曾经做过一个类似的,也是对双引号进行修改。这题要使用整行读人,我习惯使用gets()函数,当然也有其他的函数get(cin,string s)、cin.getline(charArray, max_length,'\n')。但有时做字符串题时会发生与换行符有关的错误,不能理解!Sample Input"To be or not to be," quoth the Bard, "thatis the question".The programming contestant repl 阅读全文
posted @ 2011-04-26 20:55 Pengchao Bai 阅读(495) 评论(0) 推荐(0)