注册 登录
编程论坛 程序供求

那位大侠帮帮忙!用汇编写个字符串统计程序和双子乘法程序

darkslayerxx 发布于 2010-08-08 08:20, 1045 次点击
要交作业不会写哦,,大侠帮帮忙写一个,谢谢了

[ 本帖最后由 darkslayerxx 于 2010-8-8 21:05 编辑 ]
5 回复
#2
darkslayerxx2010-08-08 21:04
那位大侠帮帮忙!写个字符串统计程序和双子乘法程序
要交作业不会写哦,,大侠帮帮忙写一个,谢谢了
#3
Antwind2010-08-08 21:26
我写了C;里面的字符串统计,汇编不会,不好意思。
看一下这个程序,交流一下:
#include<stdio.h>
#include <string.h>
#define maxstrings 200
   struct strs
{  char * strings[maxstrings];
   int num;
};
struct strs ST;
int maxchars;
void instrctions()
{
  printf("****please input some sets******");
  printf("maxchars:");
  scanf("%d",&maxchars);
  getchar();
}
void getstrings()
{  int i=0;
    char *p;
  while(1)
  {    printf("please input the strings press y");
        if(getchar()=='y')
     {    getchar();
          p=(char*)malloc(maxchars*sizeof(char));
          if(p==NULL) exit(0);
           scanf("%s",p);
          getchar();
           ST.strings[i++]=p;
     }
       break;
  }
        ST.num=i;

}
void outs()
{   int i;
  printf("the strings numbers :%d",ST.num);
  printf("Do you want check some strings, please answer \’Y\'or \'N\'");
     if(getchar()=='Y')
     { getchar();
       for(i=0;i<ST.num;i++)
       { printf("%s\n",ST.strings[i]);
        }
      }
}
void main()
{
  instrctions();
  getstrings();
  outs();
  getch();
}
#4
chenliyu2010-08-10 14:50
这是汇编么?
#5
qw51515512010-08-15 14:51
2222
1