이녀석이 급식충임을 잊지 말자
오전에 존나 빡공 영혼 빨리듯이 공부하면
집에 돌아와서 쳐 논다.
반대로 오전에 쳐 놀면
집에 돌아와서 쳐 놀더라
음?
프로그래밍 이야기:
오늘 자바 시간에는 자바 시험에 대비하여 연습문제를 풀어 보았다.
int형이 char형으로 강제형변환이 안 되는게 문화컬쳐였다.
scanner는 char형을 반환하질 못하더라
자바 좆도 없는 줄 알고 손 놓고 있었는데 채소 연습문제는 다 풀어봐야겠다
이대로 시험 쳤으면 손코딩 문제에서 C처럼 짜서 다 날라갔을 듯.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | import java.util.Scanner; public class Main3rd { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); // 1번 int n = scanner.nextInt(); for(int i = n; i > 0; i--){ for(int j = 0; j < i; j++){ System.out.print('*'); } System.out.print('\n'); } // 2번 char c = scanner.next().charAt(0); c++; //자바에서는 int => char는 허용되지 않음. for(char i = c; i > 0; i--){ //c + (char)1 이런거 안 됨. for(char j = 'a'; j < i; j++){ System.out.print(j); } System.out.print('\n'); } // 3번 int toBin = scanner.nextInt(); int ones = 0; int times = 0; int rest = -1; int pseudoBin = 0; while(toBin != 1){ rest = toBin % 2; pseudoBin += rest * Math.pow(10, times); if(rest == 1) ones++; toBin = toBin / 2; times++; } pseudoBin += Math.pow(10, times); System.out.println("bin: " + pseudoBin + " num of 1:" + ones + " times: " + times); } } | cs |
뭐하는 코드인지 맞춰보라우
크 자바까지 섭렵
핵교에서 강제로 멕여서 그래... swing에서 JLabel을 rotation시키니 뱅글뱅글 돌아가는거 보니까 허탈하더라