Exercise02_11
import javax.swing.JOptionPane;
public class Population{
public static void main(String[] args){
int sum,s,years;
String number;
number = JOptionPane.showInputDialog(null,"Enter the number of years:");
years=Integer.parseInt(number);
s=365*years*24*60*60;
sum=312032486+s/7-s/13+s/45;
int messageType=JOptionPane.INFORMATION_MESSAGE;
String message="The population in " + years + " is " + sum;
JOptionPane.showMessageDialog(null,message,"result",messageType );
}
}
Exercise02_11的更多相关文章
随机推荐
- HDU 多校对抗赛 J Time Zone
Time Zone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- codeforces2015ICL,Finals,Div.1#J Ceizenpok’s formula 扩展Lucas定理 扩展CRT
默默敲了一个下午,终于过了, 题目传送门 扩展Lucas是什么,就是对于模数p,p不是质数,但是不大,如果是1e9这种大数,可能没办法, 对于1000000之内的数是可以轻松解决的. 题解传送门 代码 ...
- JavaScript 被忽视的细节
语句/表达式 换个角度理解语句(statemaents)和表达式(expressions):表达式不会改变程序的运行状态,而语句会.还有一种叫做表达式语句,可以理解为表达式和语句的交集,如({a:1} ...
- demo 集合
github: https://github.com/zhanghaifeng1234565/ProjectFunctionCollect https://github.com/XY-W ...
- 请把<ul><li>第1行</li><li>第2行</li>...</ul>(ul之间有10个li元素)插入body里面,注意:需要考虑到性能问题。
var html = [],i;for(i = 0; i < 10; i++){ html.push('<ul><li>第' + (i+1) + '行</li> ...
- CSS3奇偶选择器
.search-form td:nth-child(odd){//奇 width:100px; text-align:right;} .search-form td:nth-child(even){/ ...
- 人脸识别 - 环境搭建(Ubuntu 16.04)
安装人脸识别开源库(face_recognition) pip3 install face_recognition 注意:pip3 尝试编译 dlib 依赖时很可能会报错,参考:https://www ...
- 在linux下搭建wiki环境【转】
转自:http://blog.csdn.net/chy800/article/details/6906090 由于公司需要一个知识共享的系统,选择wiki来实现.经过准备决定使用Linux+xampp ...
- 4.flume实战(一)
需求:从指定网络端口采集数据输出到控制台 使用flume的关键就是写配置文件 a)配置source b)配置channel c)配置sink d)把以上三个组件串起来 我们看一下官网给的配置文件 # ...
- elasticsearch SpanNearQuery inOrder参数
一直没有注意还有一个inOrder参数: public SpanNearQuery(SpanQuery[] clauses, int slop, boolean inOrder) When inOrd ...