Chardonnay

Question

Solution

Idea

This is a give-away question after you understand what ths question is asking you to do. Basically, it is that if your recipe is below 7 and not 0, you must open a bottle of wine and you can enjoy one more cup after you finish treating the recipe because there is leftover.

Code

https://github.com/mendax1234/Coding-Problems/blob/main/kattis/chardonnay/chardonnay.c
#include <stdio.h>

int main()
{
  int recipe;
  scanf("%d", &recipe);
  if (recipe != 0 && recipe != 7)
  {
    recipe += 1;
  }
  printf("%d\n", recipe);
}

Last updated