Created
June 17, 2023 00:07
-
-
Save estelabn/c9884b1fae2ba6492813721bce6c1da8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> //declaramos a biblioteca que vamos usar | |
using namespace std; | |
int main(){ // escrevemos o nosso programa dentro da função principal-> vai ser executado | |
int p, d, b; // declaramos as variáveis p - pao, d - doce, b - bolo | |
cin >> p >> d >> b; // vamos atribuir os valores lidos às variaveis | |
int soma = 0; | |
soma = soma + p; | |
soma = soma + 2*d; | |
soma = soma + 3*b; | |
if(soma >= 150) cout << "B\n"; | |
else if(soma >= 120) cout << "D\n"; | |
else if(soma >= 100) cout << "P\n"; | |
else cout << "N\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment