ADVERTISEMENT

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Friday 2 September 2016

CSE1002:PP3:Chess,Carrom,Scrabble

void set::get()
{
 int n;
 cin>>n;
 int i;
 cin.get();
 for(i=0;i<n;i++)
 {
  cin.getline(names[i],20);
 }
 names[i][0]='\0';
}
void set::print() const
{
 int i=0;
 while(names[i][0]!='\0')
 {
  if(i==0)
  cout<<names[i];
  else
  cout<<","<<names[i];
  i++;
 }
 cout<<endl;
 
}
set set::difference(set& a)
{
 set diff;
 int i=0;
 int p=0;
 while(names[i][0]!='\0')
 {
  int j=0;
  int c=0;
 
  while(a.names[j][0]!='\0')
  {
   if(strcmp(names[i],a.names[j])==0)
   {
    c=1;
    break;
   }
   j++;
  }
  if(c!=1)
  {
   strcpy(diff.names[p],names[i]);
   p++;
  }
  i++;
 }
 diff.names[p][0]='\0';
 return diff;
 
}
set set::intersection(set& a)
{
 set diff;
 int i=0;
 int p=0;
 while(names[i][0]!='\0')
 {
  int j=0;
  int c=0;
 
  while(a.names[j][0]!='\0')
  {
   if(strcmp(names[i],a.names[j])==0)
   {
    c=1;
    break;
   }
   j++;
  }
  if(c==1)
  {
   strcpy(diff.names[p],names[i]);
   p++;
  }
  i++;
 }
 diff.names[p][0]='\0';
 return diff;
 
}



No comments:

Post a Comment