Expand|Select|Wrap|Line Numbers
- // Color Number.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include<conio.h>
- #include<iostream>
- #include <stdlib.h>
- #include <string.h>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int k,sum;
- cout << "Enter the Graph vertex number: ";
- cin >> k;
- int i, j, *a, b[100];
- a = new int [i][j];
- cout << "your Gragh is" << k << " , " << k << ", enter your numbers:"<< endl;
- for (i = 0; i<k; i++)
- {
- for (j = 0; j<k; j++)
- {
- cout << "[ " << i + 1 << " , " << j + 1 << " ] = ";
- cin >> a[i*j];
- }
- cout << endl;
- }
- for (i = 0; i<k; i++)
- {
- for (j = 0; j<k; j++)
- {
- sum += a[j];
- }
- b[i] = sum;
- cout << b[i];
- sum = 0;
- }
- return 0;
- }