题目链接: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. 83、Tensorflow中的变量管理

    ''' Created on Apr 21, 2017 @author: P0079482 ''' #如何通过tf.variable_scope函数来控制tf.ger_variable函数获取已经创建 ...

  2. ajax请求在参数中添加时间戳

    ajax请求在参数中添加时间戳 参考网址

  3. Java核心基础知识(一):概念、语法、使用、源码

    1. Java中OOP的特点? OOP(Object Oriented Programming):面向对象编程.具有封装.继承.多态三大特征. 封装:解决数据安全性问题: 继承:解决代码的重用性问题: ...

  4. Leetcode代码复盘_分治法相关

    分治法 1.二分搜索(算法时间复杂度O(log n)) 输出:如果x=A[j],则输出j,否则输出0. 1.binarysearch(1,n) 过程:binarysearch(low,high) 1. ...

  5. 19-python基础-进制之间的转换

    二进制-八进制-十进制-十六进制相互转换 1.十进制转为其他进制 # (1)十进制转二进制 a = 8 bin(a) --->>'0b1000' # (2)十进制转八进制 oct(a) - ...

  6. css中的居中问题

    前两天写了一篇关于display:table的用法,里面涉及到居中的问题,这两天愈发觉得css中的居中是一个值得关注的问题,现总结如下. 一.垂直居中 (1)inline或者inline-*元素 1. ...

  7. 使用apache搭建tomcat集群

    1.安装apache 1.1 下载ApacheX64.rar,并解压 1.2 修改Apache24\conf\httpd.conf文件 配置根目录: 配置ip和端口 1.2 安装apache服务器 以 ...

  8. 从一个url地址到最终页面渲染完成,发生了什么?

    从一个url地址到最终页面渲染完成,发生了什么? 1.DNS 解析 : 将域名地址解析为IP地址 浏览器DNS缓存 系统DNS缓存 路由器DNS缓存 网络运营商DNS缓存 递归搜索: www.baid ...

  9. 【记录】利用Jquery 在 textarea 内实现文字动态换行

    背景: 最近在做前端时候遇到一种情况,需要用js动态输入内容到textarea, 比如实时聊天功能,用户A每次发送信息都需要另起一行. 问题: 根据以往经验,以为用$('#textArea').htm ...

  10. 【LeetCode】BFS || DFS [2017.04.10--2017.04.17]

    [102] Binary Tree Level Order Traversal [Medium-Easy] [107] Binary Tree Level Order Traversal II [Me ...