Skip to content

Instantly share code, notes, and snippets.

@hansen033
Created December 4, 2017 14:33
Show Gist options
  • Select an option

  • Save hansen033/9d8f2348b2a2d4d10556b3d108ebdcf3 to your computer and use it in GitHub Desktop.

Select an option

Save hansen033/9d8f2348b2a2d4d10556b3d108ebdcf3 to your computer and use it in GitHub Desktop.
2017/11/23
#include <iostream>
using namespace std;
int main()
{
int num[10], AL;
cout << "請輸入要算的10個平均數(小數點會不見):\n";
for( int t = 0,plus ; t < 10 ; t ++ ){
cin >> num[t];
}
for( int t = 0,plus ; t < 10 ; t ++ ){
AL += num[t];
}
cout << "\n這10個數的平均數是:" << AL / 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment