题目链接: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. linux命令行光标移动技巧

    看一个真正的专家操作命令行绝对是一种很好的体验-光标在单词之间来回穿梭,命令行不同的滚动.在这里强烈建立适应GUI节目的开发者尝试一下在提示符下面工作.但是事情也不是那么简单,还是需要知道“如何去做” ...

  2. VMware里克隆出来的CentOS Linux device eth0 does not seem to be present, delaying initialization

    解决办法:1.ifconfig eth1 确定新网卡的MAC地址.nmcli con 确定新网卡的UUIDvim /etc/udev/rules.d/70-persistent-net.rules把原 ...

  3. nginx 配置反向代理和静态资源

    https://unit.nginx.org/integration/ 与NGINX集成 在NGINX后面安装单元 将NGINX配置为静态Web服务器,并在Unit前面配置反向代理. NGINX直接从 ...

  4. LVM-扩容目录

    LVM LVM是一种源自Unix环境,在Linux上广泛应用的逻辑虚拟盘存储方案.借助LVM,可以在保证各个Linux目录分区稳定,又可以实现各目录存储资源灵活分配. 本文主要系统介绍Linux环境下 ...

  5. is, ==, id, encode,

    1. is 和 == 的区别 1. id(): 通过id()我们可以查看到⼀个变量表⽰的值在内存中的地址. id(变量)  返回给你这个变量的内存地址 is 比较是的内存地址  == 比较的是值 s ...

  6. [English]could, should, would, may 非單只是過去式

    助動詞 could, should, would, may 的用法:(第三冊) 標題句:You should stay here. Would you like to order now? Could ...

  7. Error(10028):Can't resolve multiple constant drivers for net “ ” at **.v

    两个进程里都有同一个条件判断的话,会产生并行信号冲突的问题. 同一个信号不允许在多个进程中赋值,否则则为多驱动. 进程的并行性决定了多进程不同能对同一个对象进行赋值.

  8. 循序渐进学.Net Core Web Api开发系列【17】:.Net core自动作业之Hangfire

    nuget搜索:Hangfire 安装即可,这里我选择的是 1.7.0-beta1 版本 我是用这个集成到了 mvc api里 这里需要在 Startup 文件里进行如下配置 在配置方法 Config ...

  9. python之arrow时间处理模块

    首先安装 pip install arrow 直接创建arrow对象 print(arrow.get(2019, 1, 23)) # 2019-01-23T00:00:00+00:00 print(a ...

  10. Jmeter请求非Json格式的参数如何添加

    Step1: 可以先在用户自定义变量中加入你需要添加的请求类型,具体参考图片 Step2: 在线程组下请求之前添加HTTP信息头管理器