1F - A+B for Input-Output Practice (III)
Input
Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.
Sample Input
1 5
10 20
0 0
Sample Output
6
30 // 先上代码对比
#include<stdio.h>
int main()
{
int a, b, t, i;
while(scanf("%d %d", &a, &b), a!=&&b!=)
printf("%d\n", a+b);
return ;
}
WA
#include<stdio.h>
int main()
{
int a, b, t, i;
while(scanf("%d %d", &a, &b), !(a==&&b==))
printf("%d\n", a+b);
return ;
}
AC
//
| a!=0 && b!=0 | !(a==0 && b==0) | |
| a真b真 | 真 | 真 |
| a真b假 | 假 | 真 |
| a假b真 | 假 | 真 |
| a假b假 | 假 | 假 |
// !(a==0&&b==0) <=> a||b
// 插入补充:命名文件时不要用空格!!!
例如:一开始我把WA的文件命名为“F”,把AC的文件命名为“F test”. 结果运行“F test”的结果和“F”的一样.
后来我运行了如下代码
#include<stdio.h>
int main()
{
int a=, b=;
while(a!=&&b!=)
{
printf("%d\n", a+b);
}
return ;
}
F test2
结果还是和“F”一样!!!大概执行程序的时候读程序名读到空格就结束吧
1F - A+B for Input-Output Practice (III)的更多相关文章
- 1.1.3 A+B for Input-Output Practice (III)
A+B for Input-Output Practice (III) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
- java hdu A+B for Input-Output Practice (III)
A+B for Input-Output Practice (III) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32 ...
- PHP-FPM-failed to ptrace(PEEKDATA) pid 123: Input/output error
If you're running PHP-FPM you can see these kind of errors in your PHP-FPM logs. $ tail -f php-fpm.l ...
- NFS挂载异常 mount.nfs: Input/output error
[root@localhost ~]# vi /etc/exports #增加/nfs 192.168.10.132(rw,no_root_squash,no_all_squash,async) [r ...
- BIOS(Basic Input/Output System)是基本输入输出系统的简称
BIOS(Basic Input/Output System)是基本输入输出系统的简称 介绍 操作系统老师说,平时面试学生或者毕业答辩的时候他都会问这个问题,可见这个问题对于计算机专业的学生来说是如此 ...
- read()、write()返回 Input/output error, Device or resource busy解决
遇到的问题,通过I2C总线读.写(read.write)fs8816加密芯片,报错如下: read str failed,error= Input/output error! write str fa ...
- Angular 个人深究(三)【由Input&Output引起的】
Angular 个人深究(三)[由Input&Output引起的] 注:最近项目在做别的事情,angular学习停滞了 1.Angular 中 @Input与@Output的使用 //test ...
- Docker 在转发端口时的这个错误Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3306:tcp:172.17.0.2:3306: input/output error.
from:https://www.v2ex.com/amp/t/463719 系统环境是 Windows 10 Pro,Docker 版本 18.03.1-ce,电脑开机之后第一次运行 docker ...
- dpdk EAL: Error reading from file descriptor 23: Input/output error
执行test程序时输出: EAL: Error reading from file descriptor 23: Input/output error 原因: 在虚拟机添加的网卡,dpdk不支持导致的 ...
- html5 填表 表单 input output 与表单验证
1.<output> Js计算结果 <form oninput="res.value = num1.valueAsNumber*num2.valueAsNumber ...
随机推荐
- 做好Unity4.x开发项目规划
1. 是否要用lua 2. (对于需操作的游戏)客户端游戏如何做战斗验证 下面列举小坑吧.不建议都绕开,毕竟没有那么多时间做前期调研的. 对应版本Unity4.x 1. 客户端程序层面 总的来说C#超 ...
- Oracle11g服务详细介绍
Oracle11g服务详细介绍及哪些服务是必须开启的? Oracle ORCL VSS Writer Service Oracle卷映射拷贝写入服务,VSS(Volume Shadow Copy Se ...
- JS----事件2
一 事件对象(event):与特定事件相关且包含有关该事件详细信息的对象 通过事件可以触发event对象的元素,鼠标的位置及状态,按下的键等等event对象只在事件发生的过程中才有效非IE浏览器里的e ...
- 常见三种字符编码的区别:ASCII、Unicode、UTF-8
什么是字符编码? 计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理.最早的计算机在设计时采用8个比特(bit)作为一个字节(byte),所以,一个字节能表示的最大的整数就是255( ...
- “2017面向对象程序设计(Java)第就九周学习总结”存在问题的反馈
对于“2017面向对象程序设计(Java)第就九周学习总结”存在问题的反馈 1.博文未写者:高树平 高俊梅 冯小丽 缪召召 王瑞强 宗鹏新 李向龙 马润韬 米奇辉 卯保云——不及时提交博客的同学人数出 ...
- python--第五天总结
装饰器-- @ 重命名原函数,返回函数对象 是一个函数,至少两层执行函数,被装饰的函数作为参数----------------------------------------------------1 ...
- 相对熵(KL散度)
https://blog.csdn.net/weixinhum/article/details/85064685 上一篇文章我们简单介绍了信息熵的概念,知道了信息熵可以表达数据的信息量大小,是信息处理 ...
- APIView和View的区别
APIView和View的区别 API继承了View 重写了as_view方法 --豁免csrf def dispatch(self, request, *args, **kwargs): self. ...
- 200. Number of Islands (Graph)
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...
- Oracle触发器用法实例详解
转自:https://www.jb51.net/article/80804.htm. 本文实例讲述了Oracle触发器用法.分享给大家供大家参考,具体如下: 一.触发器简介 触发器的定义就是说某个条件 ...