Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- cout<< "Total number of the students: ";
- int n;
- cin>> n;
- string name[n] , district[n];
- int age[n];
- cout<<"Name Age District"<<endl;
- for(int i=0; i<n; i++)
- {
- cin>> name[i] >> age[i]>> district[i];
- }
- cout<< "\nPrint all students details of age less than 20:\n";
- for(int i=0; i<n; i++) {
- if(age[i] < 20) {
- cout<< name[i] << " "<< age[i]<< " " << district[i]<< endl;
- }
- }
- cout<< "\nNumber of students of Rajshahi District: ";
- int cnt= 0;
- for(int i=0; i<n; i++) {
- if(district[i] == "Rangpur" ) {
- cnt++;
- }
- }
- cout<< cnt<< endl;
- int cnt2=0;
- for(int i=0; i<n; i++) {
- if(name[i][0] == 'S' ) {
- cnt2++;
- }
- }
- cout<< "\nNumber of students name start with S: "<< cnt2<< endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement