⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssss.cpp

📁 输入一篇文章,统计各个字出现的次数,希望大家能优化这个程序
💻 CPP
字号:
#include <iostream.h>
#include <string.h>
#include <malloc.h>
struct Word
{
	char word[10];
	
	Word *next;
};

 Word  *head;
 Word  *create()
 {
   Word  *p=NULL;
   Word  *q=NULL;
  
   head=NULL;
   char danci[10];


    cout<<"请输入你的文章:"<<endl;
    cin>>danci[10];
	while(danci[10]!='$' )
	{
		
		p=new Word;
		strcpy(p->word,danci);
		

		if(head==NULL)
			head=p;
	     else q->next=p;

	      q=p;

		 cin>>danci[10];
	}
	   
	    if(head!=NULL)
	    q->next=NULL;
	     return(head);
     
 }



tongji(Word *head)
{   
	int sum=1;
    Word *temp,*p,*q;
	p=head;
	(p!=NULL)
		p->next=q;
     temp=p;
	
	
   while(p!=NULL&&strcmp(p->word,q->word)!=0)
   {
	   cout<<p;
       
	   q=q->next;
   }

   while(strcmp(head->word,word)==0)
   {

	   sum +=sum;
   cout<<head<<sum;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -