| 目次| 1234567891011121314
| 資料| 予定| 課題| 宿題|

情報基礎講義メモ [第14回:8/20]

  1. 配布資料
  2. 今日の予定
  3. プログラミング解答と補足

    1. 3,6=3+3,
    2. 	# coding: utf-8
      	sum = 0
      	i = 3
      	while i < 100 :
      		sum = sum + i
      		i = i + 3
      	print(sum)
      	    
    3. 3=1*3,6=2*3,
    4. 	# coding: utf-8
      	sum = 0
      	i = 1
      	while i*3 < 100 :
      		sum = sum + i*3
      		i = i + 1
      	print(sum)
      	    
    5. 1,2,
    6. 	# coding: utf-8
      	sum = 0
      	i = 1
      	while i < 34 :
      		sum = sum + i*3
      		i = i + 1
      	print(sum)
      	    
    7. 余り
    8. 	# coding: utf-8
      	sum = 0
      	i = 1
      	while i < 100 :
      		if i%3==0 :
              		sum = sum + i
      		i = i + 1
      	print(sum)
      	    
    9. forの例1
    10. 	# coding: utf-8
      	sum = 0
      	for i in range(1,34) :
      		sum = sum + i*3
      	print(sum)
      	    
    11. forの例2
    12. 	# coding: utf-8
      	sum = 0
      	for i in range(0,100,3) :
      		sum = sum + i
      	print(sum)
      	    
    13. forの例3
    14. 	# coding: utf-8
      	sum = 0
      	for i in range(0,100) :
      		if i%3==0 :
              		sum = sum + i
      	print(sum) 	
      	    
    15. 課題
    16. なし
    17. 宿題
    18. なし
    19. 連絡事項
    20. なし

    | 目次| 1234567891011121314
    | 資料| 予定| 課題| 宿題|