随笔分类 -  算法小习题

 
算法习题
摘要:1.// 计算一个整数的位数.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#includeusing namespace std;int wei(int a){static int total=0;if(a/1000000000!=0) return total=10;else if(a/100000000!=0) return total=9;else if(a/10000000!=0) return total=8;else if(a/1000000!=0) return total=7;else if(a/100000!=0) r 阅读全文
posted @ 2013-08-20 14:11 ljy2013 阅读(267) 评论(0) 推荐(0)
算法习题
摘要:// 打折.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){int a;double total;cout>a;if(95*a>300)total=(95*a)*0.85;else total=95*a;cout//#include //#include #include //定义数学函数 using namespace std;int _tmain(int argc, _TCHAR* argv[]) 阅读全文
posted @ 2013-08-17 20:47 ljy2013 阅读(241) 评论(0) 推荐(0)