//选票系统
#include<iostream>
using namespace std;
int main()
{
int i, v0 = 0, v1 = 0, v2 = 0, v3 = 0, n, a[50];
cout << "Please enter the number of elestorrate:";
cin >> n;
cout << "Please enter 1 or 2 or 3 ";
for (i = 0; i < n; i++)
cin >> a[i];
for (i = 0; i < n; i++)
{
if (a[i] ==1)
v1++;
if (a[i] == 2)
v2++;
if (a[i] == 3)
v3++;
else
v0++;
}
cout << "candiate 1:" << v1 << endl;
cout << "candiate 2:" << v2 << endl;
cout << "candiate 3:" << v3 << endl;
cout << "not use:" << v0<< endl;
return 0;
}
矩阵转置
//矩阵转置
#include<iostream>
using namespace std;
int main()
{
int i, j, i1, j1, a[101][101], b[101][101];
cout <