题目描述:圆周上有N(N#includeusing namespace std;int main(){ long long ans,n,i; cin>>n; ans=1; for (i=n-5;i<=n;++i) ans=ans*i; ans=ans/720; cout<<ans<<endl;}
分类:
其他好文 时间:
2014-11-05 16:57:45
阅读次数:
105
想排序后进行操作,然后进行原序输出??;可以记录一个顺序,之后对顺序排序,但也可如下; 1 // cout 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 stru....
分类:
编程语言 时间:
2014-11-05 12:30:14
阅读次数:
140
1,__func__宏:仍然用__FUNCTION__,可用于来初始化成员列表2,//cout<<__STDC_HOSTED__<<endl;//支持//cout<<__STDC__<<endl;//不支持//依赖编译器//cout<<__STDC_VERSION__<<endl;//不支持//依赖编译器//cout<<__STDC_ISO_10646_..
分类:
编程语言 时间:
2014-11-05 00:41:32
阅读次数:
345
程序代码:
#include
using namespace std;
#define DEBUG
#ifndef DEBUG
#define ASSERT(x)
#else
#define ASSERT(x) if(!(x)){ cout<<"错误!ASSERT("<<#x<<")宏函数执行失败;"; cout<<"错误代码出现在第"<< __LINE__ <<"...
分类:
其他好文 时间:
2014-11-04 15:03:06
阅读次数:
163
代码实例:
#include
using namespace std;
void show()
{
cout<< "该语句所在的函数名为:"<< __FUNCTION__ <<endl;
cout<< "当前文件名为:" << __FILE__ <<endl;
cout<< "当前代码所在行为:" << __LINE__ <<endl;
}
int main...
分类:
其他好文 时间:
2014-11-04 13:16:14
阅读次数:
154
本节对cin,cout,cerr,clog,>>和using namespace std;int main(){ char str[256]; int i; cout>i;//可故意输入若干非数字字符,下次再输入若干字符加数字串加若干非数字字符进行检测 while(cin...
分类:
编程语言 时间:
2014-11-04 10:42:04
阅读次数:
280
#includeusing namespace std;int n;int dfs(int n){return n == 1 ? 1 : dfs(n / 2) + 1;}int main(){ while (cin >> n) cout << dfs(n) << endl; ...
分类:
其他好文 时间:
2014-11-03 23:54:14
阅读次数:
231
文档:http://www.cprogramming.com/tutorial/lesson6.html1.头文件#include 是C语言的,而C++要用#include 否则以下程序不能输出字符串:int main(){string a = "333ddd";cout using namespa...
分类:
编程语言 时间:
2014-11-03 22:16:27
阅读次数:
199
int main(){ char a[6]="hello"; char b[6]="hello"; char* c="hello"; char* d="hello"; //*(c+1)='!';出错 if(a==b) cout<<"1"<<endl;...
分类:
编程语言 时间:
2014-11-03 20:44:47
阅读次数:
230
//HeapOnly.cpp 只能在堆或者栈上分配内存的类 #include using namespace std; class HeapOnly { public: HeapOnly() { cout destroy(); ...
分类:
其他好文 时间:
2014-11-03 01:15:42
阅读次数:
203