This would be flamebait on a c++ board. You have A TON OF non-standard
headers and errors in your code.
WTF? DO NOT USE VOID MAIN()!!!!!!!!!!
christ, its int main()
and iostream.h is a nonstandard header
<< I get 21 errors when i try to compile this...anyone wanna take a stab at it (this is the TA's solution...so i assume it works)
NOTE: I added the #include "stdafx.h" part myself
#include "stdafx.h"
#include <iostream.h>
#include <string.h>
void main()
{
string words[20], temp;
int ii=0, flag, wordcount;
cout<<"Enter the words"<<endl;
do{ ii++;
cin>>words[ii]; } while(words[ii]!="quit");
wordcount = ii-1;
for(ii=0; ii<wordcount; ii++)
{
for(int j=ii+1; j<=wordcount; j++)
{
if(words[j]<words[ii]){
temp=words[j];
words[j]=words[ii];
words[ii]=temp;
}
}
}
cout<<"input after repeating repition and sorting"<<endl;
for(int j=0; j<=ii; j++){
flag = 0;
int k =0;
while(k<j && flag ==0){
flag = (words[j]==words[k]);
k++;
}
if(flag==0)
cout<<words[j]<<" ";
}
cout<<endl;
} >>