2012年9月13日

编程练习11

摘要: 大数相乘 1 //大数相乘 2 #include <iostream> 3 using namespace std; 4 5 void invert(char str1[],char str2[]) 6 { //------------------------------------------- 7 //这前面都是初始化操作,没什么东西 8 int len1=strlen(str1),len2=strlen(str2); 9 int* num1=(int*)malloc(sizeof(int)*len1);10 int* num2=(int*)malloc(... 阅读全文

posted @ 2012-09-13 09:30 lyncre 阅读(152) 评论(0) 推荐(0)

编程练习10

摘要: 都是水题啊 1 //连续字符统计,如aabcccd输出a2b1c3d1 2 #include <iostream> 3 using namespace std; 4 #define N 100 5 6 void func(char* str) 7 { 8 pair<char,int> pr; 9 int i,j=0,len=strlen(str);10 int num[N]={0};11 char c[N]={0};12 13 c[0]=str[0];14 num[0]=1;15 for(i=1;i<len;++i)16 {17... 阅读全文

posted @ 2012-09-13 09:25 lyncre 阅读(127) 评论(0) 推荐(0)

导航