mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
start:java8
This commit is contained in:
19
com/study/demo/test2_5.java
Normal file
19
com/study/demo/test2_5.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.study.demo;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class test8 {
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
int x = scanner.nextInt();
|
||||
int k = scanner.nextInt();
|
||||
int a = x / 1000 % k;
|
||||
int b = x / 100 % 10 % k;
|
||||
int c = x / 10 % 10 % k;
|
||||
int d = x % 10 % k;
|
||||
System.out.print(a);
|
||||
System.out.print(b);
|
||||
System.out.print(c);
|
||||
System.out.println(d);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user