已知长方形的长和宽,求它的周长和面积。
牛牛学矩形
https://ac.nowcoder.com/acm/problem/21998
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d\n%d",2*(a+b),a*b); }
- Point:
- 转义应该是
\
而不是/
2*(a+b)
的*
不能省略
牛牛学矩形
https://ac.nowcoder.com/acm/problem/21998
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d\n%d",2*(a+b),a*b); }
\
而不是/
2*(a+b)
的*
不能省略 相关推荐