SlideShare a Scribd company logo
1 of 3
#include<iostream>
#include<conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;
int main()
{
int i,j,l;
int tsc=12;
float bat_ave[12]={25,28,34,38,5,6,10,9,48,55,50,58};
float bowl_ave[12]={30,32,33,37,25,22,19,17,100,110,90,105};
char cat[12]
[15]={"all_rounder","all_rounder","all_rounder","all_rounder","bowler","bowler",
"bowler","bowler","batsman","batsman","batsman","batsman"};
cout<<"n Initial Set:";
cout<<"nbatting_avetwicket_avetOutput";
for(i=0;i<12;i++)
{
cout<<"n"<<bat_ave[i]<<"t"<<bowl_ave[i]<<"t"<<cat[i];
}
int bowl_a;
int bat_a;
cout<<"n Enter the player batting average :";
cin>>bat_a;
cout<<"n Enter the player bowling average :";
cin>>bowl_a;
int k;
cout<<"n Enter the value of 'k':";
cin>>k;
float d[12][2],t ;
float c[12][2],m;
float e[12][2],f[12][2];
//calculating distance to each value in training set
for(i=0;i<12;i++)
{
f[i][0]=i;
t=bowl_ave[i]-bowl_a;
m=bat_ave[i]-bat_a;
d[i][1]=t*t;
c[i][1]=m*m;
e[i][1]=d[i][1]+c[i][1];
f[i][1]=sqrt(e[i][1]);
}
cout<<"full distance"<<endl;
for(i=0;i<12;i++){
cout<<f[i][1]<<endl;
}
//Sorting
for(i=0;i<11;i++)
{
for(j=0;j<11;j++)
{
if(f[j][1]>f[j+1][1])
{
t=f[j][1];
f[j][1]=f[j+1][1];
f[j+1][1]=t;
l=f[j][0];
f[j][0]=f[j+1][0];
f[j+1][0]=l;
}
}
}
cout<<"in sorting"<<endl;
for(i=0;i<12;i++){
cout<<f[i][1]<<endl;
}
cout<<"numbersss"<<endl;
for(i=0;i<12;i++){
cout<<f[i][0]<<endl;
}
int no_all=0; //no of allrounder
int no_bat=0; //no of batsman
int no_bowl=0; //no of bowlers
cout<<"nbattingtbowlingtOutputn";
for(i=0;i<k;i++)
{
l=f[i][0];
cout<<bat_ave[l]<<"t"<<bowl_ave[l]<<"t"<<cat[l]<<"n";
if(strcmp(cat[l],"all_rounder")==0)
{
no_all++;
}
if(strcmp(cat[l],"batsman")==0)
{
no_bat++;
}
if(strcmp(cat[l],"bowler")==0)
{
no_bowl++;
}
}
cout<<"n No of allrouder:"<<no_all;
cout<<"n No of batsman:"<<no_bat;
cout<<"n No of bowler:"<<no_bowl;
if(no_all>no_bat&&no_all>no_bowl)
{
cout<<"n the new player is classified as allrounder"<<endl;
}
if(no_bat>no_all&&no_bat>no_bowl)
{
cout<<"n the new player is classified as batsman"<<endl;
}
if(no_bowl>no_bat&&no_bowl>no_all)
{
cout<<"n the new player is classified as bowler"<<endl;
}
getch();
}

More Related Content

What's hot

Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cythonAnderson Dantas
 
Programação completa e perfeira
Programação completa e perfeiraProgramação completa e perfeira
Programação completa e perfeiraMagno Rodrigues
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauReact London 2017
 
3分くらいで分かるassert()
3分くらいで分かるassert()3分くらいで分かるassert()
3分くらいで分かるassert()Ippei Ogiwara
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvassuitzero
 
Programming assignment 30 12-11
Programming assignment 30 12-11Programming assignment 30 12-11
Programming assignment 30 12-11Bilal Maqbool ツ
 
メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割Koichiro Eto
 
New text document
New text documentNew text document
New text documentPavel111212
 
สุภาษิตล้านนา
สุภาษิตล้านนาสุภาษิตล้านนา
สุภาษิตล้านนาmuttana
 
CBSE, Grade12, Computer Science, Random Numbers - Notes
CBSE, Grade12, Computer Science, Random Numbers - NotesCBSE, Grade12, Computer Science, Random Numbers - Notes
CBSE, Grade12, Computer Science, Random Numbers - NotesMalathi Senthil
 
The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181Mahmoud Samir Fayed
 

What's hot (20)

Basics
BasicsBasics
Basics
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
Programação completa e perfeira
Programação completa e perfeiraProgramação completa e perfeira
Programação completa e perfeira
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher Chedeau
 
Cpp c++ 2
Cpp c++ 2Cpp c++ 2
Cpp c++ 2
 
Linux tips
Linux tipsLinux tips
Linux tips
 
3分くらいで分かるassert()
3分くらいで分かるassert()3分くらいで分かるassert()
3分くらいで分かるassert()
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvas
 
Programming assignment 30 12-11
Programming assignment 30 12-11Programming assignment 30 12-11
Programming assignment 30 12-11
 
Rabia
RabiaRabia
Rabia
 
Abebe1
Abebe1Abebe1
Abebe1
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
Aayojan1
Aayojan1Aayojan1
Aayojan1
 
メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割メディアアートにおけるプログラミング言語Rubyの役割
メディアアートにおけるプログラミング言語Rubyの役割
 
New text document
New text documentNew text document
New text document
 
สุภาษิตล้านนา
สุภาษิตล้านนาสุภาษิตล้านนา
สุภาษิตล้านนา
 
CBSE, Grade12, Computer Science, Random Numbers - Notes
CBSE, Grade12, Computer Science, Random Numbers - NotesCBSE, Grade12, Computer Science, Random Numbers - Notes
CBSE, Grade12, Computer Science, Random Numbers - Notes
 
Shell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbaiShell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbai
 
The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181
 
A
AA
A
 

Similar to C++ KNN Classification Cricket Player

Bubble archery game(c program)
Bubble archery game(c program)Bubble archery game(c program)
Bubble archery game(c program)SETYA HADI
 
Bubble archery game(c program)
Bubble archery game(c program)Bubble archery game(c program)
Bubble archery game(c program)SETYA HADI
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programsKandarp Tiwari
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Santiago Sarmiento
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++Neeru Mittal
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
2 BytesC++ course_2014_c4_ arrays
2 BytesC++ course_2014_c4_ arrays2 BytesC++ course_2014_c4_ arrays
2 BytesC++ course_2014_c4_ arrayskinan keshkeh
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start sedalipkumar64
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings imtiazalijoono
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 

Similar to C++ KNN Classification Cricket Player (20)

Bubble archery game(c program)
Bubble archery game(c program)Bubble archery game(c program)
Bubble archery game(c program)
 
Bubble archery game(c program)
Bubble archery game(c program)Bubble archery game(c program)
Bubble archery game(c program)
 
project3
project3project3
project3
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++
 
C arrays
C arraysC arrays
C arrays
 
C program
C programC program
C program
 
4. chapter iii
4. chapter iii4. chapter iii
4. chapter iii
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
2 BytesC++ course_2014_c4_ arrays
2 BytesC++ course_2014_c4_ arrays2 BytesC++ course_2014_c4_ arrays
2 BytesC++ course_2014_c4_ arrays
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
Os lab 1st mid
Os lab 1st midOs lab 1st mid
Os lab 1st mid
 
Os lab upto_1st_mid
Os lab upto_1st_midOs lab upto_1st_mid
Os lab upto_1st_mid
 
Os lab upto 1st mid
Os lab upto 1st midOs lab upto 1st mid
Os lab upto 1st mid
 
C programms
C programmsC programms
C programms
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

C++ KNN Classification Cricket Player

  • 1. #include<iostream> #include<conio.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> using namespace std; int main() { int i,j,l; int tsc=12; float bat_ave[12]={25,28,34,38,5,6,10,9,48,55,50,58}; float bowl_ave[12]={30,32,33,37,25,22,19,17,100,110,90,105}; char cat[12] [15]={"all_rounder","all_rounder","all_rounder","all_rounder","bowler","bowler", "bowler","bowler","batsman","batsman","batsman","batsman"}; cout<<"n Initial Set:"; cout<<"nbatting_avetwicket_avetOutput"; for(i=0;i<12;i++) { cout<<"n"<<bat_ave[i]<<"t"<<bowl_ave[i]<<"t"<<cat[i]; } int bowl_a; int bat_a; cout<<"n Enter the player batting average :"; cin>>bat_a; cout<<"n Enter the player bowling average :"; cin>>bowl_a; int k; cout<<"n Enter the value of 'k':"; cin>>k; float d[12][2],t ; float c[12][2],m; float e[12][2],f[12][2]; //calculating distance to each value in training set for(i=0;i<12;i++) { f[i][0]=i; t=bowl_ave[i]-bowl_a; m=bat_ave[i]-bat_a; d[i][1]=t*t; c[i][1]=m*m; e[i][1]=d[i][1]+c[i][1]; f[i][1]=sqrt(e[i][1]); } cout<<"full distance"<<endl; for(i=0;i<12;i++){ cout<<f[i][1]<<endl; } //Sorting for(i=0;i<11;i++) { for(j=0;j<11;j++) {
  • 2. if(f[j][1]>f[j+1][1]) { t=f[j][1]; f[j][1]=f[j+1][1]; f[j+1][1]=t; l=f[j][0]; f[j][0]=f[j+1][0]; f[j+1][0]=l; } } } cout<<"in sorting"<<endl; for(i=0;i<12;i++){ cout<<f[i][1]<<endl; } cout<<"numbersss"<<endl; for(i=0;i<12;i++){ cout<<f[i][0]<<endl; } int no_all=0; //no of allrounder int no_bat=0; //no of batsman int no_bowl=0; //no of bowlers cout<<"nbattingtbowlingtOutputn"; for(i=0;i<k;i++) { l=f[i][0]; cout<<bat_ave[l]<<"t"<<bowl_ave[l]<<"t"<<cat[l]<<"n"; if(strcmp(cat[l],"all_rounder")==0) { no_all++; } if(strcmp(cat[l],"batsman")==0) { no_bat++; } if(strcmp(cat[l],"bowler")==0) { no_bowl++; } } cout<<"n No of allrouder:"<<no_all; cout<<"n No of batsman:"<<no_bat; cout<<"n No of bowler:"<<no_bowl; if(no_all>no_bat&&no_all>no_bowl) { cout<<"n the new player is classified as allrounder"<<endl; } if(no_bat>no_all&&no_bat>no_bowl) { cout<<"n the new player is classified as batsman"<<endl; } if(no_bowl>no_bat&&no_bowl>no_all) { cout<<"n the new player is classified as bowler"<<endl;