Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: KHOPAN

Problemset: ผลรวมตัวเลข

Language: c

Time: 0.002 second

Submitted On: 2025-09-29 15:29:06

#include <stdio.h>
#include <stdint.h>

int main(const int argc, const char* const* const argv) {
	uint16_t lower;
	uint16_t upper;

	if(scanf("%hu%hu", &lower, &upper) < 2) {
		return 1;
	}

	uint32_t sum = 0;

	for(uint16_t i = lower; i < upper; i++) {
		sum += i % 2 == 0 || i % 3 == 0 ? i : 0;
	}

	printf("%u\n", sum);
	return 0;
}