长度为n的字符串的逆序数

#include<iostream>using namespace std;int main(int argc, char *argv[]){ int n; while(cin>>n) { int count=0; char *str = new char[n]; cin>>str; for(int k=1; k<n; ++k) { char elem=str[k]; for(int j=(k-1); j!=(-1); --j) { ...
2011-08-23 23:59 | 阅读 720 次 | 评论 0 条

任务日志--运算符重载

为了领积分哈!随便贴一段代码哈,O(∩_∩)O~! #include<iostream>#include<string>using namespace std; class fraction; //const fraction operator=(const fraction &amp;f1,const fraction &amp;f2); const fraction operator+(const fraction &amp;f1,const fraction &amp;f2); const fraction operator-(const fract...
2011-06-27 08:59 | 阅读 664 次 | 评论 0 条
浏览5686次
最新评论