![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++基础
fanlinqiang
这个作者很懒,什么都没留下…
展开
-
1
//求n以内(不包括n)同时能被3和7整除的所有自然数之和的平方根s,//并作为函数值返回。例如若n为1000时,函数值应为:s=153.909064。#include#include#includeusing namespace std;double f(int x){ double sum=0; for(int i=3;i<x;i++) { if(i%原创 2012-10-25 20:43:05 · 360 阅读 · 0 评论 -
十进制转十六进制
#includeusing namespace std;int main(){ int n; while(cin>>n) { int tmp,i=0,arr[101]; while(n>0) { tmp=n%16; arr[++i]=tmp; n/=16;原创 2012-10-25 21:16:03 · 330 阅读 · 0 评论 -
给出年月日输出下一天的日期
//给出年月日输出下一天的日期#includeusing namespace std;const int num[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};bool check(int x)//判断是否是闰年{ if((x%4==0&&x%100!=0)||x%400==0) return true; return原创 2012-10-25 21:04:30 · 2962 阅读 · 0 评论 -
读数
#includeusing namespace std;int main(){ string str[10]={"","shi","bai","qian","wan","shi wan","bai wan","qian wan","yi"}; string num[10]={"ling","yi","er","san","si","wu","liu","qi","ba","j原创 2012-10-26 12:39:19 · 533 阅读 · 0 评论