C/Language Basics/Operator Rank — различия между версиями
| Admin (обсуждение | вклад) м (1 версия: Импорт контента...) | |
| (нет различий) | |
Версия 14:20, 25 мая 2010
Operator sequence
#include <stdio.h>
int main(void)
{
  int rooms, len, width, total;
  int i;
  printf("Number of rooms? ");
  scanf("%d", &rooms);
  total = 0;
  for(i = rooms; i > 0; i--) {
    printf("Enter length: ");
    scanf("%d", &len);
    printf("Enter width: ");
    scanf("%d", &width);
    total = total + len * width;
  }
  printf("Total square footage: %d", total);
  return 0;
}