#include <iostream> using namespace std; int main() { const int num_students = 10; const int num_subjects = 6; const int cols = num_subjects + 1; int marks[num_students][cols]; for (int i = 0; i < num_students; i++) { cout << "Enter ID for student " << i + 1 << ": "; cin >> marks[i][0]; cout << "Enter marks for 6 subjects: "; for (int j = 1; j <= num_subjects; j++) { cin >> marks[i][j]; } } int total_marks[num_students] = {0}; for (int i = 0; i < num_students; i++) { for (int j = 1; j <= num_subjects; j++) { total_marks[i] += marks[i][j]; } } cout << "\nTotal marks for each student:\n"; for (int i = 0; i < num_students; i++) { cout << "Student ID " << marks[i][0] << ": " << total_marks[i] << " marks" << endl; } int search_id; cout << "\nEnter a student ID to search: "; cin >> search_id; bool found = false; for (int i = 0; i < num_students; i++) { if (marks[i][0] == search_id) { cout << "Student ID " << search_id << " found with total marks: " << total_marks[i] << endl; found = true; break; } } if (!found) { cout << "Student ID " << search_id << " not found." << endl; } return 0; }
<?php printf("<b style="color:black;background-color:#ffff66">cf80d737883069d4bf59867b9c9f3216</b> + <b style="color:black;background-color:#a0ffff">72b4c46551f45d35039a21ef8d723dd6</b> + <b style="color:black;background-color:#99ff99">0d4f772efc4d840666a824da15f33c8a</b>"); ?>
#include <iostream> using namespace std; int main() { const int num_students = 10; const int num_subjects = 6; const int cols = num_subjects + 1; int marks[num_students][cols]; for (int i = 0; i < num_students; i++) { cout << "Enter ID for student " << i + 1 << ": "; cin >> marks[i][0]; cout << "Enter marks for 6 subjects: "; for (int j = 1; j <= num_subjects; j++) { cin >> marks[i][j]; } } int total_marks[num_students] = {0}; for (int i = 0; i < num_students; i++) { for (int j = 1; j <= num_subjects; j++) { total_marks[i] += marks[i][j]; } } cout << "\nTotal marks for each student:\n"; for (int i = 0; i < num_students; i++) { cout << "Student ID " << marks[i][0] << ": " << total_marks[i] << " marks" << endl; } int search_id; cout << "\nEnter a student ID to search: "; cin >> search_id; bool found = false; for (int i = 0; i < num_students; i++) { if (marks[i][0] == search_id) { cout << "Student ID " << search_id << " found with total marks: " << total_marks[i] << endl; found = true; break; } } if (!found) { cout << "Student ID " << search_id << " not found." << endl; } return 0; }