From 5229722c9243fbdd08d7fa2b84ebff2b20e49dba Mon Sep 17 00:00:00 2001 From: Rohan Sharma Date: Sun, 20 Sep 2015 16:15:00 +0530 Subject: [PATCH 1/5] Create Rohan Sharma_14CSE_Jarvis --- Rohan Sharma_14CSE_Jarvis | 133 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 Rohan Sharma_14CSE_Jarvis diff --git a/Rohan Sharma_14CSE_Jarvis b/Rohan Sharma_14CSE_Jarvis new file mode 100644 index 0000000..9ca924c --- /dev/null +++ b/Rohan Sharma_14CSE_Jarvis @@ -0,0 +1,133 @@ +/* +Name: Rohan Sharma +Roll no.: 14BTCSERS046 +Stream: CSE +Compiler: GNU GCC +IDE: Code Blocks +OS: Windows 8.1 Pro +*/ + +#include +#include +#include //for 'exit()' + +using namespace std; + +/*--------------- +Global Variables +-----------------*/ +int a[1024][1024]; + +/*---------------------------- +Function Declaration +------------------------------*/ +void fill_recursively(int,int); + +int main() +{ + char c; + int i,j,row=0,col=0; + ifstream fin; //to create input stream + fin.open("input.txt",ios::in); //to connect 'input.txt' to input stream 'fin' + fin.seekg(0); //to bring file pointer to file beginning + if(!fin) //to prompt error message if input file is not present + { + cout<<"Please add the file 'input.txt' in the same directory!\n\n"; + system("pause"); + exit(0); + } + while(!fin.eof()) //to count number of rows & columns & store the matrix from file in the 2D array 'a' + { + fin.get(c); + if(isdigit(c)) + { + a[row][col++]=c-48; + } + if(c=='\n') + { + row++; + col=0; + } + } + row++; + col--; + fin.close(); //to disconnect 'input.txt' from 'fin' + /* + To start filling from boundary of the 2D array + Note: Outside filled places become '2' + */ + for(i=0;i Date: Sun, 20 Sep 2015 16:20:18 +0530 Subject: [PATCH 2/5] Update Rohan Sharma_14CSE_Jarvis --- Rohan Sharma_14CSE_Jarvis | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rohan Sharma_14CSE_Jarvis b/Rohan Sharma_14CSE_Jarvis index 9ca924c..ac9aeb1 100644 --- a/Rohan Sharma_14CSE_Jarvis +++ b/Rohan Sharma_14CSE_Jarvis @@ -21,6 +21,10 @@ int a[1024][1024]; /*---------------------------- Function Declaration ------------------------------*/ +/* +This functions recursively fills the surroundings of a[i][j] (i,j are passed to the function) +Note: Surroundings are top, bottom, left, right +*/ void fill_recursively(int,int); int main() From 49efbd60961ec56c75fc45618c77f86294c29aef Mon Sep 17 00:00:00 2001 From: mayankmadness Date: Mon, 21 Sep 2015 10:47:06 +0530 Subject: [PATCH 3/5] Create mayank gupta 14cs hal9000 --- mayank gupta 14cs hal9000 | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 mayank gupta 14cs hal9000 diff --git a/mayank gupta 14cs hal9000 b/mayank gupta 14cs hal9000 new file mode 100644 index 0000000..fecbb21 --- /dev/null +++ b/mayank gupta 14cs hal9000 @@ -0,0 +1,57 @@ +/*mayank gupta 14cs hal9000 +os windows 8.1 +compiler devc++*/ + +#include +#include +int main() +{ int a[100],b[100],c,d,temp,temp2,sum=0; +printf("enter the length of vector a"); +scanf("%d",&c); +for(int i=0;i=0;i--){ + for(int j=0;j<=i;j++){ + if(a[j]>a[j+1]){ + temp=a[j]; + a[j]=a[j+1]; + a[j+1]=temp;//bubble sort a + } + } + } + for(int i=d-2;i>=0;i--){ + for(int j=0;j<=i;j++){ + if(b[j]>b[j+1]){ + temp2=b[j]; + b[j]=b[j+1]; + b[j+1]=temp2;//bubble sort b + } + } + } + for( int i=0;i Date: Mon, 21 Sep 2015 11:16:44 +0530 Subject: [PATCH 4/5] Create testfile --- testfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 testfile diff --git a/testfile b/testfile new file mode 100644 index 0000000..6f670c0 --- /dev/null +++ b/testfile @@ -0,0 +1 @@ +test 1 From f70f4617812e64afe8634fe5ab5d07a56b3d9627 Mon Sep 17 00:00:00 2001 From: Hitkul Date: Mon, 21 Sep 2015 11:37:02 +0530 Subject: [PATCH 5/5] Delete testfile --- testfile | 1 - 1 file changed, 1 deletion(-) delete mode 100644 testfile diff --git a/testfile b/testfile deleted file mode 100644 index 6f670c0..0000000 --- a/testfile +++ /dev/null @@ -1 +0,0 @@ -test 1