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 ...
随机推荐
- Hibernate 再接触 组件映射
将另外一个类嵌入到另外一个类 从而合并生成一张表 Husband.java package com.bjsxt.hibernate; import javax.persistence.Embedded ...
- centos6.5下oracle自动备份删除指定天数的文件
第一步先做一个备份 #!/bin/sh export ORACLE_BASE=/home/oracle/app export ORACLE_HOME=/dbhome_1 export ORACLE_S ...
- C++与java编程区别(一)
转载自http://blog.sina.com.cn/s/blog_75f4e17c0101295o.html C++ HelloWorld main.cpp #include< iostrea ...
- unity3d assetbundle打包策略
由于assetbundle打包存在依赖的问题,所有资源要进行合理的分包 零.代码 代码都放在本地,包括NGUI等插件的代码.shader代码(内置的shader无需打包,而自定义的shader还是需要 ...
- idea git 把本地项目上传到github上
创建一个项目,在项目文件夹下执行以下命令 第二种方法: 先在idea上创建一个项目 注意以上只是在本地建立了本地仓库,代码都放在本地仓库. 现在上传到github上 到此才上传成功
- 使用javap进行反编译Java枚举
这是一个枚举类Day.java public enum Day { MONDAY("星期一"), TUESDAY("星期二"), WEDNESDAY(" ...
- 在webpack构建的项目中使用vue
一.复习在普通网页中使用vue1.使用script引入vue2.在index中创建 id为app的容器3.通过new vue得到vm实例二.在webpack中尝试使用vue://注意 : 在webpa ...
- NTKO OFFICE文档控件
目录 前言 什么是ntko 准备工作 实战演练 总结 一.前言 Web开发中经常需要用到在线处理office文档的功能,现在市面上有一些常用的Web页面调用显示Office的控件技术,用起来很方便. ...
- Memory Controller
1.S3C6410 地址空间 For memory at the table details 2. SDRAM图解 3. SDRAM 芯片容量计算: L_BANK 数目 * 一个 L_BANK 中的单 ...
- Linus运行jar包的操作
cd / 返回最顶层文件夹cd home/numa 进入home下的numa文件夹ll 查看当前文加夹下的所有文件ps -ef | grep java ...