Created
April 22, 2015 00:21
-
-
Save rogerioagjr/956a6606502e17256828 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 <cstdio> // scanf e printf | |
int main(){ | |
int n, soma=0; // declaro a variável n e a variável soma com valor zero | |
scanf("%d", &n); // leio o número na tela e salvo em n | |
for(int i=1; i<=n; i++){ // repito n vezes o processo entre chaves | |
int davez; // declaro o inteiro davez | |
scanf("%d", &davez); // leio o valor na tela e salvo em davez | |
if(davez>10) soma+=davez; // se davez for maior que 10, somo o seu valor à variável soma | |
} | |
printf("%d\n", soma); // imprimo o valor de soma seguido da quebra de linha | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment