REST
1) Enter three values
2) Show me result of rest(%)
package
output;
import
java.util.Scanner;
public
class
Rest {
public
static
void
main(String[]args){
Scanner br =
new
Scanner(System.in);
int
a = br.nextInt();
int
b = br.nextInt();
int
c = br.nextInt();
System.out.println((a+b)%c);
System.out.println((a%c + b%c)%c);
System.out.println((a*b)%c);
System.out.println((a%c * b%c)%c);
}
}
'Algorithm&DataStructures > StepByStep' 카테고리의 다른 글
[Algorithm] 백준알고리즘_CountBackwardsN (0) | 2016.08.23 |
---|---|
[Algorithm] 백준알고리즘_N (0) | 2016.08.23 |
[Algorithm] 백준알고리즘_A/B (0) | 2016.08.18 |
[Algorithm] 백준알고리즘_A-B (0) | 2016.08.18 |
[Algorithm] 백준알고리즘_A+B (0) | 2016.08.18 |