UVa Problem 10035 Primary Arithmetic (小学生算术)
来源:互联网 发布:车牌识别软件 编辑:程序博客网 时间:2024/04/30 05:02
// Primary Arithmetic (小学生算术)// PC/UVa IDs: 110501/10035, Popularity: A, Success rate: average Level: 1// Verdict: Accepted// Submission Date: 2011-05-27// UVa Run Time: 0.068s//// 版权所有(C)2011,邱秋。metaphysis # yeah dot net//// 因为只是统计进位,故不需保存相加结果,可以利用这一点。注意输出单复数的差别。#include <iostream>using namespace std;int main(int ac, char *av[]){int first, second;while (cin >> first >> second, first || second){int carry = 0;int counter = 0;while (first && second){carry = (((first % 10 + second % 10 + carry) > 9) ? 1 : 0);counter += carry;first /= 10;second /= 10;}while (first){carry = ((first % 10 + carry > 9) ? 1 : 0);counter += carry;first /= 10;}while (second){carry = ((second % 10 + carry > 9) ? 1 : 0);counter += carry;second /= 10;}if (counter > 1)cout << counter << " carry operations." << endl;else if (counter == 1)cout << "1 carry operation." << endl;elsecout << "No carry operation." << endl;}return 0;}
- UVa Problem 10035 Primary Arithmetic (小学生算术)
- UVa 10035 - Primary Arithmetic
- uva 10035 - Primary Arithmetic
- UVA 10035 - Primary Arithmetic
- uva 10035 - Primary Arithmetic
- UVa OJ 10035-Primary Arithmetic
- UVa OJ 10035 Primary Arithmetic
- UVa 10035 Primary Arithmetic (陷阱较多~)
- Problem I: 小学生算术
- POJ Problem 2562 Primary Arithmetic
- UVa Problem Solution: 10035 - Primary Arithmatic
- (hnust 1208)Problem C: Primary Arithmetic(水题)
- 11.24 作业 Problem E: 小学生算术
- UVa 10948 - The primary problem
- Primary Arithmetic
- Primary Arithmetic
- Primary Arithmetic
- Primary Arithmetic
- [记录]Java获取各种常用时间方法
- 页面表格实现不刷新排序 - javaScript
- No result defined for action com.bjsxt.struts2.ognl.OgnlAction and result SUCCESS
- 单元测试资料
- MySQL数据库连接:java/sql/SQLClientInfoException
- UVa Problem 10035 Primary Arithmetic (小学生算术)
- 2011-5-28微软笔试小记
- Android开发入门之三--Android Overview
- poj 2894 Ancient Keyboard
- UVa Problem 10018 Reverse and Add (反转相加)
- UVa Problem 701 The Archeologist’s Dilemma (考古学家的烦恼)
- UVa Problem 10127 Ones (仅由 1 组成的数)
- UVa Problem 847 A Multiplication Game (乘法游戏)
- UVa Problem 10105 Polynomial Coefficients (多项式系数)