Untitled
unknown
plain_text
2 years ago
432 B
2
Indexable
Never
#include<stdio.h> int main() { int a = 0, b = 0, incial = 0, final = 0, i = 0, soma = 0; scanf("%i", &a); scanf("%i", &b); if(b > a){ incial = a; final = b; }else{ incial = b; final = a; } for (i = (incial + 1); i < final; i++) { if(i % 2 != 0){ soma = soma + i; } } printf("%i\n", soma); return 0; }