-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest1.java
More file actions
33 lines (30 loc) · 732 Bytes
/
test1.java
File metadata and controls
33 lines (30 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package edu.java;
public class test1 {
public static void modPrint(int number, int mode){
int temp = number/mode;
int restidual = number-temp*mode;
if (temp>=1){
if(restidual == 0&&temp >1){
modPrint(temp-1, mode);
}
else if(restidual >0){
modPrint(temp, mode);
}
}
int mod = (number-temp*mode)%mode;
String[] base2 = {"d","a","b","c"};
System.out.print(base2[mod]);
}
public static void main(String[] args) {
String[] base = {"a","b","c","d","aa","ab","ac","ad","ba","bb","bc","bd","ca","cb","cc","cd","da","db","dc"};
//modPrint(8,4);
//
//
//System.out.println(3%7);
//System.out.println(7%11);
for(int i = 1; i<135; i++){
modPrint(i,4);
System.out.println();
}
}
}