Skip to content

Instantly share code, notes, and snippets.

@caser
Created October 31, 2013 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save caser/7256196 to your computer and use it in GitHub Desktop.
Save caser/7256196 to your computer and use it in GitHub Desktop.
Sign Up
Feature: Sign up
In order to sign up for a free account
A user
Should provide a user name, password, and email address
Scenario: Signs up for a free account
Given I am on the "sign up" page
And I fill in "username" with "casey"
And I fill in "password" with "secret"
And I fill in "email" with "casey@email.me"
When I press "Sign up"
Then the page should have a message saying "Your account has been successfully created."
Scenario: Password too short
Given I am on the sign up page
And I fill in "username" with "casey"
And I fill in "password" with "a"
And I fill in "email" with "casey@email.me"
When I press "Sign up"
Then the page should have a message saying "Password too short. Please enter a valid password."
Scenario: Missing email
Given I am on the sign up page
And I fill in "username" with "casey"
And I fill in "password" with "secret"
And I fill in "email" with ""
When I press "Sign up"
Then the page should have a message saying "Please enter a valid email address."
Scenario: Username already exists
Given I am on the sign up page
And the user with "username:casey" already exists
And I fill in "username" with "casey"
And I fill in "password" with "secret"
And I fill in "email" with "casey@email.me"
When I press "Sign up"
Then the page should have a message saying "Username already taken. Please choose a new username."
Scenario: Email already exists
Given I am on the sign up page
And the user with "email:casey@email.me" already exists
And I fill in "username" with "casey"
And I fill in "password" with "secret"
And I fill in "email" with "casey@email.me"
When I press "Sign up"
Then the page should have a message saying "Email address associated with an existing account. If it is your account, please visit the sign in page."
Scenario: Missing email
Given I am on the sign up page
And I fill in "username" with "casey"
And I fill in "password" with "secret"
And I fill in "email" with ""
When I press "Sign up"
Then the page should have a message saying "Please enter a valid email address."
@sumisuri
Copy link

#include <stdio.h>

int main(void) {
int i,j,k,n;
scanf("%d",&n);
int arr[n];
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int max=arr[0];
for(i=1;i<n;i++)
{
if(arr[i]>max)
{
max=arr[i];
j=i;
}
}
arr[j]=0;
printf("%d\n",j);
int sec_max=arr[0];
for(i=1;i<n;i++)
{
if(arr[i]>sec_max)
{
sec_max=arr[i];
k=i;
}
}
printf("(%d\t%d)",j,k);
if(k<j)
{
printf("Yes!! sec_max is left of max");
}
else

printf("No!! sec_max is not left of max");return 0;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment