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. ...
随机推荐
- JavaScript:闭包
根据MDN上的解释『闭包是指函数有自由独立的变量.换句话说,定义在闭包中的函数可以“记忆”它创建时候的环境.』 闭包有两个主要的作用: 1.访问内部函数的局域变量: 2.将创建的变量永久保存在内存中, ...
- IP的正则表达式
首先分析IP地址0-255: 0-9: [0-9]或 \d表示数字 10-99: [1-9]\d 100-199: 1/d{2} 200-249: 2[0-4]\d 250-25 ...
- Same Tree [LeetCode]
Problem Description: http://oj.leetcode.com/problems/same-tree/ class Solution { public: bool isSame ...
- collectionView初始化
collectionView初始化时一定要加layout.不然会报错: UICollectionView must be initialized with a non-nil layout param ...
- hive分区导致FAILED: Hive Internal Error: java.lang.NullPointerException(null)
写了一条hive sql ,其中条件中存在 dt>=20150101 and dt<=20150228 这样的条件,原来执行没问题,今天就抛出 FAILED: Hive Internal ...
- input file类型,文件类型的限制
直接限制input type='file'的文件类型限制,通过accept属性进行设定,多个类型用逗号分隔开,因为accept是html5的新特性,所以火狐和IE的支持就显得单薄了, 如:
- Vim经典讲解
http://blog.csdn.net/niushuai666/article/details/7275406
- ajax简单封装
var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); ...
- spring+springmvc+mybatis整合
1.web.xml配置 <?xml version="1.0" encoding="UTF-8"?> <web-app version=&qu ...
- S1 :闭包
闭包是指有权访问另一个函数作用域中的变量的函数.创建闭包的常见方式,就是在一个函数内部创建另一个函数,以createComparisonFunction()函数为例 function createCo ...