전체 글204 n값을 입력받아 1부터 1/n까지의 합을 구하는 프로그램 public class WhileStatement { public static void main(String[] args) { int n, i; double h=0.0; System.out.print("값을 입력하세요"); n=System.in.read()-'0'; //1자리의 숫자를 읽음 i=1; while (i 2010. 11. 2. For문의 반복실행 1부터 n까지의 합 구하기(i값 증가시켜서 구함) sum=0; for(i=1; i0; --i) sum+=i; ---------------------- 배열에있는 원소 출력 for(i=0; i 2010. 11. 2. For문과 While문 for(식1 ; 식2 ; 식3) ------------- 식1 while(식2){ 식3 } 식1: 초기화 식2: 조건식 식3: 증감식 2010. 11. 2. 영어날짜 쓰는법, 읽는법 -월 1월 Janunary 2월 February 3월 March 4월 April 5월 May 6월 June 7월 July 8월 August 9월 September 10월 October 11월 November 12월 December -일 1일 first 17일 seventeenth 2일 second 18일 eighteenth 3일 third 19일 nineteenth 4일 fourth 20일 twentieth 5일 fifth 21일 twenty - first 6일 sixth 22일 twenty - second 7일 seventh 23일 twenty - third 8일 eighth 24일 twenty - fourth 9일 ninth 25일 twenty - fifth 10일 tenth 26일 twenty - .. 2010. 10. 9. 이전 1 ··· 45 46 47 48 49 50 51 다음