这是一道简单的数学计算问题 主义好输出格式就好 #include<stdio.h> int main() { printf("n e\n- \n"); int a[10]; a[0]=1; for(int i=1;i<10;i++) a[i]=a[i-1]*i; double e[10]; e[0] ...
分类:
其他好文 时间:
2017-05-06 19:54:49
阅读次数:
122
Given a sequence a11 ,a22 ,a33 ......ann , your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in th ...
分类:
其他好文 时间:
2017-05-05 01:02:35
阅读次数:
174
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r ...
分类:
其他好文 时间:
2017-05-01 00:23:56
阅读次数:
123
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line ...
分类:
其他好文 时间:
2017-04-29 23:38:51
阅读次数:
215
Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... ...
分类:
其他好文 时间:
2017-04-29 23:30:32
阅读次数:
161
Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in ...
分类:
其他好文 时间:
2017-04-29 23:28:38
阅读次数:
231
Administration of the labyrinth has decided to start a new season with new wallpapers. For this purpose they need a program to calculate the surface a ...
分类:
其他好文 时间:
2017-04-27 23:08:32
阅读次数:
240
#coding=utf-8 #Naive Bayes #Calculate the Prob. of class:clsdef P(data,cls_val,cls_name="class"): cnt = 0.0 for e in data: if e[cls_name] == cls_val: ...
分类:
其他好文 时间:
2017-04-25 23:31:06
阅读次数:
208
//使用递归来计算阶乘#include<stdio.h>long rfact(int n);int main(){ int num; printf("This program calculate factorials.\n"); printf("Enter a value in the range ...
分类:
编程语言 时间:
2017-04-10 23:41:44
阅读次数:
268
1.计算(a/b)%c,其中b能整除a 设a=b*r=(bc)*s+b*t 则(b*t)为a除以bc的余数 r=c*s+t 而 (a/b)%c=r%c=t (a%bc)/b=(b*t)/b=t 所以对于b与c互素和不互素都有(a/b)%c=(a%bc)/b成立。 当bc不大时,先取模bc,再除b 如 ...
分类:
其他好文 时间:
2017-04-01 23:45:48
阅读次数:
420