POJ 2562
#include<iostream>
#include<algorithm>
#define MAXN 15
using namespace std; //int rec[MAXN]; int main()
{
//freopen("acm.acm","r",stdin);
int ans;
int x;
int y;
int dight_x;
int dight_y;
int i;
int rec;
while(cin>>x>>y)
{
if(!x&&!y)
break;
ans = ;
i = ;
rec = ;
while(y||x)
{
dight_x = x%;
dight_y = y%;
x /= ;
y /= ;
if(rec + dight_x + dight_y > )
{
rec = ;
++ ans;
}
else
rec = ;
}
if(ans == )
cout<<"No carry operation."<<endl;
else if(ans > )
cout<<ans<<" carry operations."<<endl;
else
cout<<ans<<" carry operation."<<endl;
}
}
POJ 2562的更多相关文章
- POJ 2562:Primary Arithmetic
Primary Arithmetic Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11135 Accepted: 40 ...
- ZOJ 2562 HDU 4228 反素数
反素数: 对于不论什么正整数x,起约数的个数记做g(x).比如g(1)=1,g(6)=4. 假设某个正整数x满足:对于随意i(0<i<x),都有g(i)<g(x),则称x为反素数. ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
随机推荐
- SQL中的split方法的使用
参数说明: 1.@String :需要split的字符串 2.@Delimiter :格式化时分隔符 3.@index :返回split后数组的值 ), ),)) ) AS BEGIN )) ) DE ...
- ibatis注意要点
一.ibatis的关键字like查询 select * from t_student where s_name '%张%'; 这种like语句在ibatis中怎么写,他们现在的项目是用ibatis作为 ...
- BZOJ [FJOI2007]轮状病毒 (找规律)
1002: [FJOI2007]轮状病毒 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 6009 Solved: 3282[Submit][Statu ...
- DocumentFragment类型
nodeType 11 nodeName #document-fragment nodeValue NULL parentNode null createdocumentfragment()方法创建了 ...
- (转)ASP.NET(C#)FileUpload实现上传限定类型和大小的文件到服务器
上传文件有两个主要的目的地,一个是服务器,另一个是数据库,ASP.NET内置了FileUpload这个上传控件,文本框显示用户选择的文件的全名. 其属性主要包括: ContenLength:上传文件大 ...
- Properties类、序列化流与反序列化流、打印流、commons-IO
Properties类 特点: 1.Hashtable的子类,map集合中的方法都可以用: 2.该集合没有泛型,键值都是字符串: 3.是一个可以持久化的属性集,键值可以存到集合中,也可存到持久化的设备 ...
- web-day15
第15章WEB15-AJAX和JQuery案例篇 今日任务 使用AJAX完成用户名的异步校验 使用JQuery完成用户名异步校验 使用JQuery完成商品信息模糊显示 使用JQuery完成省市联动效果 ...
- java基础-day27
第04天 java基础加强 今日内容介绍 u Xml的综合案例 u 注解 u 类的加载 u 动态代理 第1章 注解 1.1 注解概述 l 什么是注解:Annotation注解,是一种代码级别的 ...
- mysql_事务
事务是针对数据的,不是针对结构的 存储引擎innodb支持事务,myisam不支持事务需求:有一张银行账户表,有A用户给B账户转账,A账户减少,B账户增加,但是A操作之后断电. 解决方案:A减少钱,但 ...
- Scala_控制结构
控制结构 if条件表达式 val x = 6 if (x>0){ println("This is a positive number") }else if(x== ...