8 Feb 2017

inlab 3 - CSE1002



IMPORTANT: Tick option "Request desktop site" while using mobile device, or else code formating may be disturbed. or alternatively hold device in landscape mode.

If there is any problem with the formatting of the blog, code etc. or if you have suggestions to improve any aspect of it contact me (reffer to contact/feedback button at top of page) along with details of the kind of device used(mobile/laptop) etc.


Code:


#include<stdio.h>
using namespace std;
int main(){
int x=1,n;
for(int i=(int)scanf("%d\n%*s%*s",&n);i<n;x*=i++,scanf("%*s"));
printf("%d",x);
}


Input:

Number of cities
Name of the cities
Home city name

Output:

Number of routes to be analyzed in brute force approach

Psuedocode:

start
input n
let x=1
for i=1 till i=n
       let x=x*i
       input string y
end for
output x
stop

No comments:

Post a Comment