Skip to content

Commit

Permalink
Create day28_solved.cpp (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhendra-20 authored and MadhavBahl committed Jan 31, 2019
1 parent 24cd7c3 commit 074fc3c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions day28/CPP.md/day28_solved.cpp
@@ -0,0 +1,34 @@
/*
Author: Shubhendra Singh
Github: shubhendra-20
*/

#include <iostream>
using namespace std;

int main() {
int i,j,n,x,flag;

cin>>n;
int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
}
cin>>x;
flag=0;
for(i=0;i<n;i++)
{
if(a[i]==x)
{
flag=1;
cout<<(i+1)<<endl;
break;
}
}
if(flag==0)
{
cout<<"undefined";
}
return 0;
}

0 comments on commit 074fc3c

Please sign in to comment.