[閒聊] 大肚很威

看板FJU-Stat97A作者 (最強一行文)時間16年前 (2009/11/19 16:08), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
#include <stdio.h> #include <stdlib.h> int main(void) { int a,b,i,sum=0; printf("請輸入一個數字:>"); scanf("%d",&a); printf("請輸入另外一個數字:>"); scanf("%d",&b); if (a%2==0) { a=a+1; } if (a%2!=0) { a=a; } for(i=a;i<=b;i+=2) { sum+=i; } printf(":>%d\n",sum); system("pause"); return(0); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.136.162.120
文章代碼(AID): #1B1FqJHj (FJU-Stat97A)