hdu 2099
PS:因为还是不爽...继续水题...感觉这道题就是考输出..
代码:
#include "stdio.h"
void cal(int a,int b);
int main(){
int a,b,i;
while(~scanf("%d%d",&a,&b) && (a || b)){
a*=;
cal(a,b);
}
return ;
}
void cal(int a,int b){
int i,flag=;
for(i=;i<=;i++){
if(flag==){
if((a+i)%b==){
if(i>=){
printf("%d",i);
flag++;
}
else{
printf("0%d",i);
flag++;
}
}
}
else{
if((a+i)%b==){
if(i>=){
printf(" %d",i);
}
else
printf(" 0%d",i);
}
}
}
puts("");
}
PS:看了大神的代码...又get到一个技能...printf("02d",2); 输出结果是02...神奇...
hdu 2099的更多相关文章
- HDU 2099 整除的尾数(枚举 & 暴搜)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2099 思路分析:这道题的解法可以说是相当暴力了,但也有一些小坑,以下几点萌新们值得留意一下: 1. 仔 ...
- hdu 2099 整除的尾数
Problem Description 一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input 输入数据有若干组,每组数据包含二个整数a,b(0< ...
- 【水】HDU 2099——整除的尾数
来源:点击打开链接 数据范围小,枚举水过就行了……不过要注意格式! #include <iostream> #include <cstring> #include <io ...
- HDU 整除的尾数 2099
解题思路:很简单的一道水题,这几天比较忙,没怎么刷题,找找自信,很快1A. 还可以,嘿嘿 #include<cstdio> #include<cstring> #inclu ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
随机推荐
- C语言中随机数相关问题
用C语言产生随机数重要用到rand函数.srand函数.及宏RAND_MAX(32767),它们均在stdlib.h中进行了声明. int rand(void);//生成一个随机数 voidsrand ...
- fushioncharts的使用教程
FusionCharts 是使用javascript 实现统计图表的js组件:其官网地址:http://www.fusioncharts.com.其早期版本FusionCharts Free 是基于f ...
- Java中print、printf、println
Java中的System.out输出会用到print.println以及printf命令. 其中 print一般的标准输出,但是不换行. println对比print即在结尾处多了换行. eg:pr ...
- alert与console.log
1.alert在页面中弹出 console.log是在控制台显示 例子 var aa="Silence"; alert(typeof(aa)); console.log(typeo ...
- ubuntu下python3安装类库
ubuntu是默认安装了python2的,所以直接使用 pip install XXX 是默认安装到python2的,安装到python3 的指令是 pip3 install XXXX 或者 pyth ...
- ocument的createDocumentFragment()方法
在<javascript高级程序设计>一书的6.3.5:创建和操作节点一节中,介绍了几种动态创建html节点的方法,其中有以下几种常见方法: · crateAttribute(name): ...
- FileUpload上传与下载
后台代码: public string connstr = "server=128.1.3.113;database=test;uid=sa;pwd=pass"; protecte ...
- jQuery插件之ajaxFileUpload 2
ajaxFileUpload.js 很多同名的,因为做出来一个很容易. 我用的是这个:https://github.com/carlcarl/AjaxFileUpload 下载地址在这里:http ...
- php solr 查询
$options = array( 'hostname' => 'localhost', 'port' => 8080, 'path' => 'solr/test'); $clien ...
- C#入门篇6-9:字符串操作 不值一提的函数【不看也行】
// 判断输入的是否全是数字:返回结果:true:全是数字:false:有字幕出现 public static bool Isaccord1(string str) { bool bl = true; ...