Professional Documents
Culture Documents
On
GAME WINNER
SUBMITTED BY:
BHASKAR MARAPELLI
Assistant professor
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES
CERTIFICATE
Earlier the language B was now used for improving the UNIX system.
Being a high-level language, B allowed much faster production of
code than in assembly language. Still, B suffered from drawbacks as it
did not understand data-types and did not provide the use of
“structures”.
1 Introduction 1-2
6 Implementation 7
8 Conclusion 10
1
INTRODUCTION
LOOPS:
1. FOR loop:
A for loop is a repetition control structure that allows you
times.
for(intiti;condition;increment)
{
Statement
}
2.While loop:
Array:
Arrays is a kind of data structure that can store a fixed-size sequential
collection of elements of the same type. An array is used to store a collection
of data, but it is often more useful to think of an array as a collection of
variables of the same type.
Declaring Arrays:
To declare an array in C, a programmer specifies the type of the elements
and the number of elements required by an array as follows.
arrayname[array size]
There are different kinds of arrays like one-
dimensional, two dimensional array and even three dimensional array.
1.One-Dimensional array:
It contains only one element i.e., for example in our program
we used char bname[15] here char bname represents array name and [15]
represents size of the array.
2.Two-Dimensional array:
The simplest form of multidimensional array is the two-
dimensional array. A two-dimensional array is, in essence, a list of one-
dimensional arrays. To declare a twodimensional integer array of size [x][y],
you would write something as follows
Array name[x][y]
AIM
3
Advantages:-
->We can store scores of 1000 players.And we can find the maximum
score among them if their score range in between -1000 to 1000.
Disadvantages:-
→We can not store scores of more than1000 players .
→The memory allocated to an array cannot be reduced or increased
because it’s of frozen fixed size.
Future enhancements:
The winner of the card game popular in Berland "Berlogging" is
determined according to the following rules. If at the end of the game
there is only one player with the maximum number of points, he is the
winner. The situation becomes more difficult if the number of such
players is more than one. During each round a player gains or loses a
particular number of points. In the course of the game the number of
points is registered in the line "name score", where name is a player's
name, and score is the number of points gained in this round, which is an
integer number. If score is negative, this means that the player has lost in
the round. So, if two or more players have the maximum number of
points (say, it equals to m) at the end of the game, than wins the one of
them who scored at least m points first. Initially each player has 0 points.
It's guaranteed that at the end of the game at least one player has a
positive number of points.
Input:
The first line contains an integer number n (1 ≤ n ≤ 1000), n is the
number of rounds played. Then follow n lines, containing the information
about the rounds in "name score" format in chronological order, where
name is a string of lower-case Latin letters with the length from 1 to 32,
and score is an integer number between -1000 and 1000, inclusive.
Output:
Print the name of the winner.
4
SYSTEM REQUIREMENTS
SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Turbo-C
Operating system: Windows Xp or later.
HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:
RAM : 8 GB
5
ALGORITHM 6
Step1: start
Step7:stop
IMPLEMENTATION 7
#include<stdio.h>
int main()
int a[1024],i,n,max=0,f;
scanf("%d",&n);
char array[n][100];
for(i=0;i<n-1;i++)
scanf("%s\n",array[i]);
scanf("%d\n",&a[i]);
if(i==0)
max=a[0];
}else if(max<a[i])
max= a[i];
f=i;
}
}printf("%s\n",array[f]); 8
return 0;
}
Sample output 9
10
CONCLUSION
We completed our project “GAME WINNER” in allotted time. We
successfully completed our project with team work, we divided our project
into parts & completed it successfully without any errors under the supervision
of D.ANAND sir.