码迷,mamicode.com
首页 >  
搜索关键字:double    ( 12800个结果
C# DateTime 与Unix时间戳转换
由于项目需要采用C/S和B/S混合设计,BS端采用PHP,CS端采用.net,共同读取mysql数据库,时间问题的解决方案/// /// 将Unix时间戳转换为DateTime类型时间 /// /// double 型数字 /// Date...
分类:其他好文   时间:2014-08-01 22:36:02    阅读次数:196
第八章--函数进阶
内联函数:在函数声明和函数定义前加上inline一个简单的计算平方的代码:#include using namespace std; inline double square(double x) { return x * x; }; int main() { cou...
分类:其他好文   时间:2014-08-01 22:32:42    阅读次数:190
c#下怎么判断一个字符串是否可以转换为double类型
using System.Text.RegularExpressions; //引入Regex命名空间bool a = Regex.IsMatch(string, @"^[+-]?\d*[.]?\d*$"); //这个方法会返回一个布尔值,如果string字符串可以转换为double,则返回Tru....
分类:其他好文   时间:2014-08-01 22:31:22    阅读次数:247
工厂模式
通过大话设计模式一书学习后,c++编写的设计模式代码: // OOTest.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "Operation.h" #include "OperationFactory.h" int _tmain(int argc, _TCHAR* argv[]) { double resurt=0; Op...
分类:其他好文   时间:2014-08-01 19:55:32    阅读次数:221
标C编程笔记day05 函数声明、文件读写、联合类型、枚举类型
函数声明:     1、隐式声明:在没有声明的情况下,系统可根据参数类型判断去调用函数(有可能出错)     2、显式声明:声明在被调用之前,如:double add(double,double);  函数声明参数可只写类型,不需要写函数体。 文件操作:     fopen  --打开文件,FILE *pFile=fopen("a.txt","w");         fopen的打...
分类:其他好文   时间:2014-08-01 19:51:23    阅读次数:200
曾经写的一个程序
#include #include #define N 2 double mianji(double x1,double y1,double x2,double y2,double x3,double y3);//计算三角形面积 double getLength(double a1,double b1,double a2,double b2);//计算两点之间的距离 double getShor...
分类:其他好文   时间:2014-08-01 19:49:42    阅读次数:284
C# Double保留小数点后面位数
Double salary1 = 10000.0; Double salary2 = 10000.12345; Double salary3 = 10000.1289; Int salary4 = 10000; string salary5 = "10000"; string salary6 = "...
分类:其他好文   时间:2014-08-01 18:49:12    阅读次数:191
华为OJ: 求小球落地5次后所经历的路程和第5次反弹的高度
学过自由落体就好,初中物理题。 import java.util.Scanner; public class reboundFiveTimes { public static void main(String args[]){ Scanner input=new Scanner(System.in); int k=input.nextInt(); double high=k/32....
分类:其他好文   时间:2014-08-01 16:09:11    阅读次数:214
HDU1202 The calculation of GPA
#include double f(double p) { if(p >= 90) return 4; if(p >= 80) return 3; if(p >= 70) return 2; if(p >= 60) return 1; return 0; } int main() { int n; double s, p, sums,...
分类:其他好文   时间:2014-08-01 09:17:11    阅读次数:231
sgu 495 Kids and Prizes
计算出每个人得到礼物的概率,然后加起来即可 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 double dp[101010]; 7 int main(){ 8 int n,m; 9 while...
分类:其他好文   时间:2014-07-31 23:37:20    阅读次数:298
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!