[C] 백준 #10430 - 나머지
·
💡 Algorithm/백준
#define _CRT_SECURE_NO_WARNINGS #include int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); printf("%d\n", (a + b) % c); printf("%d\n", ((a%c)+(b%c))%c); printf("%d\n", (a*b)%c); printf("%d", ((a%c)*(b%c))%c); return 0; }
[C] 백준 #2588 - 곱셈
·
💡 Algorithm/백준
#define _CRT_SECURE_NO_WARNINGS #include int main(void) { int a, b; scanf("%d %d", &a, &b); printf("%d\n", a * (b % 10)); printf("%d\n", a * ((b / 10) % 10)); printf("%d\n", a * ((b / 100) % 10)); printf("%d", a * b); return 0; }
[JAVA] 백준 #9498 - 시험 성적 출력
·
💡 Algorithm/백준
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int score; score=sc.nextInt(); if ( score >=0 && score = 90) { System.out.println("A"); } else if (score >= 80) { System.out.println("B"); } else if (score >= 70) { System.out.println("C"); } else if (score >= 60) { System.out.println("D"); } else { System.out.println("F"); }..
[JAVA] 백준 #2753 - 윤년 판별하기
·
💡 Algorithm/백준
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int year = sc.nextInt(); if((year%4==0 && year%100!=0)||(year%400==0)){ System.out.println("1"); } else System.out.println("0"); } }
[JAVA] 백준 #14681 - 사분면 고르기
·
💡 Algorithm/백준
package backjoon; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x=sc.nextInt(); int y=sc.nextInt(); if(x>0 && y>0){ System.out.println(1); } else if(x0){ System.out.println(2); } else if(x