fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a,b,C,S;
  5. scanf("%d%d",&a,&b);
  6. C = 2*(a + b);
  7. S = a * b;
  8. printf("周长 = %d\n面积 = %d",C,S);
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0s 5284KB
stdin
 1 2
stdout
周长 = 6
面积 = 2