- // #include <iostream>
-
-
#include "Sales_item.h"
-
#include <string>
-
#include <vector>
-
-
using std::cin;
-
using std::cout;
-
using std::string;
-
using std::endl;
-
using std::vector;
-
int main()
-
{
-
vector<string> text;
-
string word;
-
cout <<"please input some word" <<endl;
-
while(cin>>word)
-
{
-
for(string::size_type i=0;i!=word.size();++i)
-
word[i]=toupper(word[i]);
-
text.push_back(word);
-
-
}
-
for(vector<string>::size_type i=0;i!=text.size();++i)
-
{
-
cout<<text[i]<<" ";
-
if((i+1)%8==0)
-
cout<<endl;
-
}
-
cout<<endl;
-
-
/*vector<int> numbers;
-
int a;
-
vector<int>::size_type i;
-
cout<<"please input a lot of integer"<<endl;
-
while(cin>>a)
-
{
-
numbers.push_back(a);
-
-
}
-
-
for(i=0;i<numbers.size()/2;++i)
-
{
-
cout<<numbers[i]+numbers[numbers.size()-(i+1)]<<endl;
-
}
-
if(numbers.size()%2!=0)
-
{
-
cout<<"the mid mumber "<<numbers[i]
-
<<" is not taking part in plus"<<endl;
-
}
-
//另外一种还不错的写法
-
for(vector<int>::size_type first=0,last=numbers.size()-1;first<last;++first,--last)
-
{
-
cout<<numbers[first]+numbers[last]<<endl;
-
}
-
if(first==last)
-
{
-
cout<<"the mid number "<<numbers[first]
-
<<"is not taking part in plus"<<endl;
-
}
-
-
*/
-
/* for(vector<int>::size_type i=0;i<numbers.size()-1;i=i+2)
-
{
-
cout<<numbers[i]+numbers[i+1]<<endl;
-
}
-
if(numbers.size()%2!=0)
-
cout<<"the last number "<<numbers[numbers.size()-1]
-
<<" is not taking part in plus "<<endl;
-
*/
-
-
-
/*string word;
-
vector<string> text;
-
-
cout<<"please input some word,then these word will push into the text"<<endl;
-
cout<<"Enter (CTRL+Z) to end"<<endl;
-
-
while(cin>>word)
-
{
-
text.push_back(word);
-
}
-
for(vector<string>::size_type i=0;i<text.size();++i)
-
text[i]="";
-
cout<<text[0]<<endl;*/
-
//string s;
-
//cout <<s[0]<<endl;
-
/*string s,s1;
-
cout <<"please input string should combine punctuation!"<<endl;
-
while(getline(cin,s))
-
{
-
s1="";
-
for(string::size_type i=0;i < s.size();++i)
-
if(!ispunct(s[i]))
-
s1+=s[i];
-
cout<<"new string "<<s1<<endl;
-
cout <<"please input string should combine punctuation!"<<endl;
-
}*/
-
/*string str,str1;
-
-
cout << "please input some strings!! "<<endl;
-
-
while(cin >> str1)
-
{
-
str+=str1;
-
str+=" ";
-
}
-
cout <<"these strings combine to "<<str<<endl;*/
-
/*string str1,str2;
-
-
cout << "please input two string ,Then I will show the answer to you !"<<endl;
-
-
while(cin>>str1>>str2)
-
{
-
if(str1==str2)
-
cout <<"str1 == str2"<<endl;
-
else if(str1 > str2)
-
cout << "str1 > str2"<<endl;
-
else
-
cout <<"str1 < str2"<<endl;
-
cout << "please input two string ,Then I will show the answer to you !"<<endl;
-
}*/
-
/*string line;
-
int n;
-
string s("Hello World!!!");
-
string::size_type punct_cnt=0;
-
-
//string str("some string");
-
for(string::size_type i=0;i<s.size();++i)
-
{
-
s[i]=tolower(s[i]);
-
if(ispunct(s[i]))
-
++punct_cnt;
-
}
-
cout << "punctuation characters in " << s <<"is "<< punct_cnt<<endl;
-
*/
-
-
/*
-
while(getline(cin,line))
-
{
-
if(line.empty())
-
{
-
cout << "line is empty" <<endl;
-
}
-
n=line.size();
-
cout << line.size() << endl;
-
cout << n <<endl;
-
cout << line << endl;
-
}*/
-
-
/*string s1,s2;
-
cout << "please input string !" <<endl;
-
while(cin >> s1)
-
{
-
cout << s1 <<endl;
-
cout << "please input string" <<endl;
-
}*/
-
//cin >> s1 >> s2;
-
// cout << s1 << s2 << endl;
-
/*Sales_item total,item;
-
//int count=1;
-
//int i=1;
-
int i=2.1;
-
std::cout<<i<<std::endl;
-
const int &r=1;
-
const int &r2=r+i;
-
unsigned char u=-1;
-
cout<<r2<<r<<std::endl;*/
-
//std::cout<<i%256<<std::endl;
-
/*if(std::cin>>total)
-
{
-
while(std::cin>>item)
-
{
-
if(total.same_isbn(item))
-
{
-
total+=item;
-
}
-
else
-
{
-
std::cout<<total<<std::endl;
-
total=item;
-
-
}
-
}
-
std::cout<<total<<std::endl;
-
}
-
else
-
{
-
std::cout<<"No numbers"<<std::endl;
-
return -1;
-
}*/
-
/*std::cin>>total;
-
while(std::cin>>item)
-
{
-
if(total.same_isbn(item))
-
++count;
-
else
-
{
-
std::cout<<"the countof the previos ISBN is "<<count<<std::endl;
-
total=item;
-
count=1;
-
}
-
}
-
std::cout<<"the count of the last ISBN is"<<count<<std::endl;*/
-
-
-
-
/*std::cin>>item1>>item2;
-
-
if(item1.same_isbn(item2))
-
{
-
std::cout<<item1+item2<<std::endl;
-
}
-
else
-
{
-
std::cout<<"error"<<std::endl;
-
}*/
-
/*std::cout<< "enter two numbers" <<std::endl;
-
int v1,v2;
-
std::cin>>v1>>v2;
-
std::cout<<"the sum of"<<v1<<"and"<<v2<<"is"<<v1+v2<<std::endl;*/
-
return 0;
-
}
阅读(1540) | 评论(0) | 转发(0) |