python acm入門で知る必要がある

1726 ワード


2016        (2017   )(140)
  1---        (17) 
   python  。
  2----        (16)
   python  。 
  3----while         (10)
   python  。    (2018.4.17)




#print        ?
print(   ,end = '')
#python        
a,b,c = 1,2,3
print(a,b,c)
#python acm         
a,b,c = input().strip().split()#  strip()    
print(a,b,c)
#strip('    ,     ')   :             
#split('       ',      )   :             
#  ,python         。
print(a+b+c,a*b*c,"{:.2f}".format((a+b+c)/3))
#     
print("{}
{}
{:.6f}".format(100,'A',3.14)) print("{:02d}:{:02d}:{:02d}".format(timeA,timeB,timeC)) #d int,2 ,0 0 。 01:08:31 # \ "\\" 。。 s = input().split() j = 0 for i in s: s[j] = int(i) j += 1 ######### , 。。 for i in s: sum += int(i) #### for i in range(len(s)): s[i] = (int)s[i] print(das,das,fds,gfd,sep=' ',end = ' ', file = ' ')
 python ,int    , float       ,   float   int  
  ,   int too large to convert to float  .
   :http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/1194.html
ac  :
while True:
    sum = 1
    x,n = input().split()
    x,n = float(x),int(n)
    for i in range(1,n+1):
        fenmu = 1.0#     1.0         float
        for j in range(2,2*i+1):
            fenmu *= j
        sum += ((-1)**i)*(x**(2.0*i))/fenmu#          float
    print('%.4f' %sum)
  python       ,     ,  int     float.
         float

# python         :
def solution():
    while True:
        try:
            n = int(input())
        except:
            break
solution()