Jump to content
IPS Community Suite 简体中文
Sign in to follow this  


Recommended Posts

已知: 不大于10的所有是3或5的倍数的数字是3,5,6,9, 这四个数字的和是23;

package main

import (

func getIt(maxInt int) int {

	r := 0
	for i := 0; i < maxInt; i++ {

		if i%3 == 0 || i%5 == 0 {
			r += i


	return r

func main() {

	maxInt := 1000



Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this