- 博客(7)
- 收藏
- 关注
原创 判断素数并输出小于n的素数。
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner (System.in) ; int a,b=0; a=sc.nextInt(); sc.close(); if (a==1) Sys...
2018-11-29 20:41:28 282
原创 输入两个正整数,求它们的最大公约数与最小公倍数。
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner (System.in) ; int a,b; a=sc.nextInt(); b=sc.nextInt(); sc.close(); System....
2018-11-29 20:01:17 1012
原创 时间间隔
import java.util.Scanner; public class Main{ public static void main(String args[]) { int a[]=new int[3]; int[]b=new int[4]; String s,s0,a11 = null,b11 = null,c11 = null; int a1,b1,c1,m,n...
2018-11-28 18:22:04 171
转载 简单计算器
import java.util.Scanner; public class Main{ public static void main(String args[]) throws Exception { int a,b; char op; Scanner sc =new Scanner(System.in); a=sc.nextInt(); b=sc.nextInt(); op...
2018-11-28 17:02:52 197
转载 判断 闰年
#include using namespace std; int main() { int year; bool leap; cin>>year; if(year%40){ if(year%1000){ if(year%400==0) leap=true; else leap=false; } else leap=true; } else leap=false; if(leap) c...
2018-11-28 14:55:50 102
原创 冒泡排序
import java.util.Scanner; public class Main{ public static void main(String args[]) { int [] a=new int[3]; Scanner sc =new Scanner(System.in); for(int i=0;i<3;i++) a[i]=sc.nextInt(); int ex=3; whil...
2018-11-28 12:34:05 68
原创 绝对值
@[从键盘上输入任意一个整数,然后输出它的绝对值! java import java.util.Scanner; public class Main { public static void main(String[] args) { int s; Scanner sc =new Scanner(System.in); s=sc.nextInt(); if(s&gt;=0) System.out...
2018-11-28 09:37:39 193
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人