博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
E. The shortest problem
阅读量:4485 次
发布时间:2019-06-08

本文共 965 字,大约阅读时间需要 3 分钟。

http://www.bnuoj.com/v3/contest_show.php?cid=7612#info

http://www.bnuoj.com/v3/contest_show.php?cid=7612#problem/

题解:http://bestcoder.hdu.edu.cn/blog/2015-multi-university-training-contest-7-solutions-by-uestc/

水题:

#include 
#include
using namespace std;int sum,x;void get_sum(int n){ while(n) { sum += n%10; n /= 10; }}void get_x(){ int times = 1; int s = sum; while(s) { s /= 10; times *= 10; } x = (x * times)+sum; x = x%11;}int main(){ int n,t; int cas = 1; while(cin>>n>>t && (n!=-1||t!=-1)) { sum = 0; x = 0; x = n%11; get_sum(n); for(int i = 1;i <= t;i ++){ get_x(); get_sum(sum); } if(x == 0) printf("Case #%d: Yes\n",cas++); else if(x) printf("Case #%d: No\n",cas++); } return 0;}

 

转载于:https://www.cnblogs.com/zhangjialu2015/p/5268121.html

你可能感兴趣的文章
Windows Store App之数据存储
查看>>
English class 82 The Importance of traveling
查看>>
python用递归函数解汉诺塔游戏
查看>>
Redis与Python交互
查看>>
Maximum-SubsequenceSum
查看>>
Android无法删除项目+导入项目报错
查看>>
poj 2349(最小生成树应用)
查看>>
python接口自动化测试二十五:执行所有用例,并生成HTML测试报告
查看>>
c# 指定的存储区提供程序在配置中找不到,或者无效
查看>>
最简陋的python数据
查看>>
第一堂java web课
查看>>
操作系统简介
查看>>
第1周小组博客作业--1703班06组
查看>>
vue项目中icon图标的完美引入
查看>>
C语言指针
查看>>
Java的安装
查看>>
0920 JSON数据 蓝懿
查看>>
Azure Cosmos DB 使用费用参考
查看>>
C# 子线程与主线程通讯方法一
查看>>
谷歌搜索语法
查看>>