题目链接:http://codeforces.com/problemset/problem/1183/A


题意:求不小于 a 且每位数和能被 4 整除的 最小 n

思路:暴力模拟就好。

AC代码:

 #include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin >> a;
bool flag = true;
int ans = ;
while(flag)
{
int t = a;
ans = ;
while(t)
{
ans += t%;
t/=;
}
if(ans % == ) flag = false;
else a++;
}
cout << a ;
return ;
}

Codeforces 1183A Nearest Interesting Number的更多相关文章

  1. Nearest Interesting Number

    Polycarp knows that if the sum of the digits of a number is divisible by 33, then the number itself ...

  2. Codeforces1183A(A题)Nearest Interesting Number

    Polycarp knows that if the sum of the digits of a number is divisible by 3, then the number itself i ...

  3. CodeForces - 598C Nearest vectors(高精度几何 排序然后枚举)

    传送门: http://codeforces.com/problemset/problem/598/C Nearest vectors time limit per test 2 seconds me ...

  4. dp --- Codeforces 245H :Queries for Number of Palindromes

    Queries for Number of Palindromes Problem's Link:   http://codeforces.com/problemset/problem/245/H M ...

  5. Educational Codeforces Round 11 D. Number of Parallelograms 暴力

    D. Number of Parallelograms 题目连接: http://www.codeforces.com/contest/660/problem/D Description You ar ...

  6. Codeforces 980 E. The Number Games

    \(>Codeforces \space 980 E. The Number Games<\) 题目大意 : 有一棵点数为 \(n\) 的数,第 \(i\) 个点的点权是 \(2^i\) ...

  7. Codeforces 724 G Xor-matic Number of the Graph 线性基+DFS

    G. Xor-matic Number of the Graph http://codeforces.com/problemset/problem/724/G 题意:给你一张无向图.定义一个无序三元组 ...

  8. 【codeforces 805D】Minimum number of steps

    [题目链接]:http://codeforces.com/contest/805/problem/D [题意] 给你一个字符串; 里面只包括a和b; 让你把里面的"ab"子串全都去 ...

  9. Codeforces J. Soldier and Number Game(素数筛)

    题目描述: Soldier and Number Game time limit per test 3 seconds memory limit per test 256 megabytes inpu ...

随机推荐

  1. 不是有效的win32应用程序

    问题描述: 用vs2012编写的程序在xp下运行提示"不是有效的win32应用程序", 改成静态编译还是会提示上面的错误 解决办法: 原来常规里面的平台工具集的设置如上,更改为下面 ...

  2. 71、salesforce的JSON方法

    List<Merchandise__c> merchandise = [select Id,Name,Price__c,Quantity__c from Merchandise__c li ...

  3. SQL之in和like的连用实现范围内的模糊查询

    我们知道in可以实现一个范围内的查询,like可以实现模糊查询, 如 select *where col like 123%但是我们如果有一列attri,如123,132,165... 我们想实现12 ...

  4. Java学习之构造函数

    构造函数特点:  函数名和类名相同  没有返回值(不用定义返回值类型)作用:  对象初始化注意:  如果类没有定义构造函数时,系统会默认定义一个无参的构造函数  如果定义了构造函数,系统不会定义构造函 ...

  5. C/s模式&&B/S模式

    C/s模式:是客户端/服务器(Client/Server)模式,主要指的是传统的桌面级的应用程序.比如我们经常用的信息管理系统. C/S 客户端/服务器 例如QQ,网络游戏,需要下载客户端才能访问服务 ...

  6. awk 按小时 统计接口调用次数

    #统计所有接口总量awk -F ' ' '{a[$7]++} END{for(i in a){print i,a[i] | "sort -r -k 7"}}' accesslog/ ...

  7. 深信服杯ctf部分wp

    CRYPTO1,NO SOS题目给了一段由.和-构成的密码由于题目提示不是摩斯码,将.和-化为0和1,长度为65位无法与8或7整除,无法转换为ascii,但可以被5整除,猜测为培根密码,将0化为a,1 ...

  8. LeetCode Array Easy 189. Rotate Array

    ---恢复内容开始--- Description Given an array, rotate the array to the right by k steps, where k is non-ne ...

  9. ionic3 图片(轮播)预览 ionic-gallary-modal组件使用方法

    一.效果展示 使用方法: 1.npm安装ionic-gallary-modal扩展模块 npm install ionic-gallery-modal --save 2.在app.module.ts根 ...

  10. MYSQL增量备份与恢复

    vim /etc/my.cnf在[mysqld]下添加max_binlog_size = 1024000 //二进制日志最大1M 要进行mysql的增量备份,首先要开启二进制日志功能方法一:在/etc ...