使用变量值进行简单计算

#include <stdio.h>

int main(void) {
  int total;
  int cats;
  int dogs;
  int ponies;
  int others;

  cats = 4;
  dogs = 3;

  ponies = 5;
  others = 6;

  total = cats + dogs + ponies + others;

  printf(We have %d pets in total\n, total);   // Output the result
  return 0;
}

相关文章

for遍历数组
。。。
声明一个计数循环
咕咕咕
#include <stdio.h> int main (void) { printf (&quo...