Last active
July 28, 2020 20:29
-
-
Save anitainfo/1777f063bad06a59767686511e162428 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> //biblioteca utilizada | |
using namespace std; | |
int main() | |
{ | |
int N, T, V, soma=0; //declaração das variáveis | |
scanf("%d", &N); //lê a primeira linha de entrada | |
for(int i=0; i<N; i++) //loop para ler as demais linhas de entrada | |
{ | |
scanf("%d %d", &T, &V); //lê o 'T' e o 'V' nas demais 'N' linhas | |
soma+=V*T; //soma o valor de 'V'x'T' à variável 'soma' | |
} | |
printf("%d", soma); //imprimi o valor da 'soma' final | |
return 0; //retorna a 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment