btcq.net
当前位置:首页 >> python被7整除不被5整除 >>

python被7整除不被5整除

for i in range(1,101): if i%7==0 and i%5!=0: print(i)

123456789 fori inrange(1,101): printi, ifi%3==0andi%5==0: print'A*B', elifi%3==0: print'A', elifi%5==0: print'B', print

sum = 0 for x in xrange(100): if x % 5 == 0 and x % 7 == 0: sum += x print 'the sum is: ', sum

123456789 if__name__ =="__main__": t =0 print("符合要抄求的2113整数5261有4102:1653") forind inrange(1, 201): ifind %7==0andind %5!=0: print(ind, end=" ") t +=1 ift %5==0: print("\n")

1 printreduce(lambdax,y:x+[0,y][y%35==0], range(35, 1001))

只计算了自然数范围内的print(sum([e for e in range(1, 1001) if not e % 3 and e % 5]))

int sum = 0, i;for(i = 100; i 评论0 0 0

#include "stdio.h"#include"stdafx.h" void main() { int x; printf("请输入一个正整数:\n"); scanf("%d",&x); if(x%5==0 && x%7 !=0) printf("x符合要求!!!"); else printf("x不符合要求!!!"); }

要用什么语言啊?3 6 9 12 18 21 24 27 33 36 39 42 48 51 54 57 63 66 69 72 78 81 84 87 93 96 9927个 我是用asp写的dim a,i a=0 for i = 1 to 100 if i mod 3 =0 and i mod 5 0 then a=a+1 response.write i & vbcrlf end if next response.write a%>

def fn1(limit): n = 3 while n

hbqpy.net | nczl.net | tfsf.net | bfym.net | jamiekid.net | 网站首页 | 网站地图
All rights reserved Powered by www.btcq.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com