#include<stdio.h>
#include<stdlib.h>
int adjust(int);
int main(){
int score,final;
printf("Enter your score: ");
scanf("%d",&score);
final=adjust(score);
printf("after adjust: %d\n",final);
system("pause");
return 0;
}
int adjust(int score){//紅色是回傳型態int、藍色是使用score收進參數(型態是int)
int temp;
if(score>=60) temp=score+5;
else temp=score+10;
return temp; //下回傳指令
}
沒有留言:
張貼留言