15周 Python入門(人生苦短,我用Python)__Python

來源:互聯網
上載者:User


for b in range(1,5):    for s in range (1,5):        for g in range (1,5):            if b!=s and b!=g and s!=g:                print b,s,g  //=======================================================# -*- coding:utf-8 -*-sums=0.0money=0.0money=raw_input("輸入獎金:")# print "hello.%s"% moneymoney=int(money)if money<=10:    sums=money*0.1elif money>10 and money <=20:    sums=1+(money-10)*0.075elif money>20 and money <=40:    sums=1.75+(money-20)*0.05elif money>40 and money <=60:    sums=2.75+(money-40)*0.03elif money>60 and money <=100:    sums=3.35+(money-60)*0.015else:    sums=3.95+(money-100)*0.01print "應發獎金為:"+ bytes(sums)# -*- coding:utf-8 -*-sums=0.0money=0.0money=raw_input("輸入獎金:")# print "hello.%s"% moneymoney=int(money)if money<=10:    sums=money*0.1elif money>10 and money <=20:    sums=1+(money-10)*0.075elif money>20 and money <=40:    sums=1.75+(money-20)*0.05elif money>40 and money <=60:    sums=2.75+(money-40)*0.03elif money>60 and money <=100:    sums=3.35+(money-60)*0.015else:    sums=3.95+(money-100)*0.01print "應發獎金為:%f" % sums//===================================================================from math import sqrtfor i in range(9999999):    temp=i+100    temp2=int(sqrt(temp))    if temp2*temp2==temp:        temp=i+268        temp2=int(sqrt(temp))        if temp2*temp2==temp:            print i//=========================================================================print("    *****   ")print("   **     ")print("  **       ")print("  **       ")print("   **      ")print("    *****   ")//======================================================================/*按公式PI/2 = ∑ (n! / (2n+1)!!) 計算Pi計算2800項就可以精確到小數點後800位*/#include "stdio.h"long b,c,d,e,f[2801];int main(){  int i;  for (i = 0; i < 2800; i++)   {  f[i] = 2000;  }  f[2800] = 0;  for (c = 2800; c > 0; c -= 14)   {    d = 0;    for (b = c; b > 0; b--)     {      d =d+ f[b] * 10000;      f[b] = d % (2*b-1);      d =d/(2*b-1);      if (b > 1)      d=d*(b-1);    }    printf("%.4d", e + d / 10000);    e = d % 10000;  }  return 0;}


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.