전체 글35 (오일러 1번)1000보다 작은 자연수 중에서 3 또는 5의 배수를 모두 더하면? #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) {int i, result;int sum1 = 0, sum2 = 0, sum3 = 0;for(i=1; i 2017. 3. 27. 아스키코드 증가를 이용한 알파벳 출력 import java.io.IOException;import java.util.Scanner; public class homework2 { public static void main(String[] args) throws IOException {// TODO Auto-generated method stubint a;int b;a = System.in.read();b = a;for(int i=97; i 2017. 3. 25. 최대공약수 import java.util.Scanner; public class homework { public static void main(String[] args) {// TODO Auto-generated method stub Scanner sc = new Scanner(System.in);int a = sc.nextInt();Scanner sc2= new Scanner(System.in);int b = sc.nextInt();int res = 0;if(a>b){for(int i=1; i 2017. 3. 25. 이전 1 ··· 6 7 8 9 다음