Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159374 王润中 【循环】整除问题(divide) C++ Runtime Error 1 MS 264 KB 237 2026-08-29 10:42:24

Tests(2/5):


Code:

#include<iostream> using namespace std; int c[110]; int main() { int a,p=0,s=0; cin>>a; for(int i=1;i<=a;i++){ if(i%3==0&&i%5==0){ p++; c[p]=i; } } for(int i=1;i<=p;i++){ s+=c[i]; } cout<<s; }


Run Info:

Runtime Error:Segmentation fault