📄 向量应用.cpp
字号:
#include<iostream.h>
#include"Sstring.h"
#include"Vector.h"
void wordLengthFreg(Vector<int> & counts){
const int Lengthmax=counts.length();
int len;
String word;
cin>>word;
while(word[0]!='N'&&word[0]!='n'){
if((len=word.StrLength())<Lengthmax)
counts[len]=counts[len]+1;
else
counts[0]=counts[0]+1;
cin>>word;
}
}
void main(){
Vector<int>Vector1(10,0);
wordLengthFreg(Vector1);
cout<<"Here is Vector1:"<<endl;
cout<<Vector1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -