zoj1001
来源:互联网 发布:极限编程 编辑:程序博客网 时间:2024/05/23 15:07
//C++
#include<iostream>
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
cout << a + b << endl;//不加endl,zoj将反馈wrong answer。
//endl刷新流的缓冲区(stream's buffer)。
}
return 0;
}
/************************************************************************************/
//C
#define _CRT_SECURE_NO_DEPRECATE
//vs2013scanf报错
//旧式的scanf在读取数据的时候会根据format指示从缓冲区中读取直至结束,
//但有些时候我们的format指示会有Bug,导致scanf读取了给定的缓冲区以外(数组越界)的数据。
//使用宏定义忽略警告,或者用scanf_s替换scanf
#include <stdio.h>
int main()
{
int a,b;
while(scanf("%d %d",&a, &b) != EOF)
printf("%d\n",a+b);
return 0;
}
0 0
- zoj1001
- zoj1001
- zoj1001
- ZOJ1001
- ZOJ1001
- zoj1001
- ZOJ1001
- Python--ZOJ1001
- ZOJ1001 A + B Problem
- 安卓推送技术手册——透传消息
- MySQL的InnoDB索引原理详解
- Rest Api how to retrieve list items from SharePoint Online
- VS2013显示行号及显示程序汇编代码
- Jump Game I , II
- zoj1001
- 字体颜色随选中状态改变
- 如何让VMware下Linux识别U盘
- Hadoop中NameNode、DataNode和Client三者之间的通信方式是什么?怎样进行合作?
- 百度笔试题:malloc/free与new/delete的区别
- 在Eclipse中导入两个名字相同的工程的方法
- 使用github管理xcode代码片段的实践
- MVC中实现生成二维码
- UML类图