Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- /*
- 變數取名僅能是英文字開頭或底線開頭
- (o) int a, _b, _, a1, a2;
- (x) int 123, 123abc;
- (x) int *, ?, !;
- */
- int a, b, h;
- scanf("%d%d%d", &a, &b, &h);
- /*
- int area;
- area = ( a + b ) * h / 2;
- printf("%d", area);
- */
- // printf可以直接輸出值,所以上式可以簡化:
- printf("%d", (a+b)*h/2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment