输入一个字符串,提取出里面的数字,并排序输出。
#include 
#include 
#include 
using namespace std;
int compare (const void *p,const void *q){
	return *(int *)q-*(int *)p;
}
int ss(string s)
{
	int len=s.length();
	int...
                            
                            
                                分类:
编程语言   时间:
2015-01-04 11:32:20   
                                阅读次数:
194
                             
                    
                        
                            
                            
                                输入人数n,开始位置s ,间隔数多少个m,输出出局序列
#include 
#include 
using namespace std;
void Out(int n,int s,int m)
{
	vector people;
	for (int i=1;i<=n;i++)
	{
		people.push_back(i);
	}
    int start = s-1;
	int ...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 10:07:21   
                                阅读次数:
145
                             
                    
                        
                            
                            
                                输入一个字符串,判断是否含有相同的子串(字串长度大于1),是输出1,否,输出0。
例如12312含有两个12,所以输出1;23456则没有相同子序列,输出0.
输入:12312
输出:1
#include
#include 
using namespace std;
int main()
{
	string s;
	while(cin>>s){
		int len=s.s...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 10:07:14   
                                阅读次数:
136
                             
                    
                        
                            
                            
                                输入一个字符串,输出出现次数最少,或者说出现频率最小的字符。
#include 
#include 
using namespace std;
int main()
{
	string s;
	cin>>s;
	int fre[26];
	memset(fre,0,sizeof(fre));
	for (int i=0;i<s.size();i++)
		fre[s[i]-'a']+...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 10:04:53   
                                阅读次数:
151
                             
                    
                        
                            
                            
                                按要求分解字符串,输入两个数M,N,M代表输入的M个待处理的字符串,N代表输出的每串字符串要处理成的位数,不够补0。
例如:
输入:2  8
          abc  123456789
输出:abc00000
          12345678,90000000
#include
#include
using namespace std;
string s;...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 01:19:40   
                                阅读次数:
183
                             
                    
                        
                            
                            
                                对整形数组按照和指定整数的差值大小进行排序,按照差值升序排列返回。
 
要求实现方法: 
public staticint[] calcTimes(int[] num, int value);
 
【输入】 num:整型数组; 
              value 指定的整数
 【返回】 按照升序返回整型数组,排序按照各个整数和指定整数的差值大小...
                            
                            
                                分类:
编程语言   时间:
2015-01-04 01:19:08   
                                阅读次数:
304
                             
                    
                        
                            
                            
                                功能描述:将字符串中的字母全部替换成字母的下一个字母,要是最后一位是z或Z则替换为a或A。 
 *        输入:aBxyZ
 *        输出:bCyzA
#include
#include
#include
using namespace std;
char ml[]="abcdefghijklmnopqrstuvwxyza";
char mu[]="ABCDEFGH...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 01:18:40   
                                阅读次数:
249
                             
                    
                        
                            
                            
                                取出整型数组中出现次数最多的元素,并按照升序排列返回。
要求实现方法: 
public static int[] calcTimes(int[] num, int len);
【输入】 num:整型数组;
              len :输入的整数个数
【返回】 按照升序排列返回整型数组中出现次数最多的元素
【注意】只需要完成该函数功能算法,中间不需要有任何IO的...
                            
                            
                                分类:
编程语言   时间:
2015-01-04 01:12:35   
                                阅读次数:
298
                             
                    
                        
                            
                            
                                两个整数相除,将结果用字符串返回。如果是循环小数,将循环的位用括号括起来。
函数原型为 void div(const int a,const int b,char *str)
输入:1 3
输出:0.(3)
#include
#include
using namespace std;
int maxn = 100; //设置字符串的最大位数
int reminder_...
                            
                            
                                分类:
其他好文   时间:
2015-01-04 01:12:02   
                                阅读次数:
279
                             
                    
                        
                            
                            
                                功能描述:将字符串中的字母全部替换成字母的下一个字母,要是最后一位是z或Z则替换为a或A。 
 *        输入:aBxyZ
 *        输出:bCyzA
#include 
#include 
int main()
{
	char a[100];
	gets(a);
	int len = strlen(a);
	for(int i=0;i<len;i++)
	...
                            
                            
                                分类:
其他好文   时间:
2015-01-03 13:18:31   
                                阅读次数:
184