Advertisement
kk258966

3/25 物件導向程式設計 練習一

Mar 25th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public class B10207081{
  2. public static void main(String args[]){
  3.  
  4. int num=0,n=10;
  5.  
  6. while(n<=30){
  7.  
  8. if(n%2==0)
  9. num+=n;
  10. n++;
  11.  
  12. }
  13.  
  14. System.out.println("總合為:"+num);
  15. System.out.println("B102107081");
  16.  
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement