Results 1 to 6 of 6
Thread: ++
Hybrid View
-
9th April 2010 02:38 #1
++
!
: 6 . .
:
#include <iostream>
using namespace std;
//
#define MAXN 1000
int a[MAXN][MAXN];
int main()
{
// ,
bool flag = 0;
int n, proizv=1, cifra;
//
cin >> n;
//
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
cin >> a[i][j];
cin >> cifra;
//
//
for(int i=0; i<n-1; i++)
{
for(int j=i; j<n; j++)
{
//
if(a[i][j] == cifra) flag = 1;
break;
}
if(flag) break;
}
// , - , -
if(flag == 1) cout << "Yes!" << endl;
else cout << "No!" << endl;
system("pause");
return 0;
}
6 : "int A [6] [6]". . - , - . ? , :
int [6][6] = { { 1, 2, 3, 4, 5, 6 }, { 7, 8, 9 } };
"define" , . , "int A [7] [7]". , ...
!!!Last edited by jonyshub; 9th April 2010 at 03:25.
-
9th April 2010 08:19 #2
0, 6. , . - , , . , - , , -. 1 0 , if(flag) break; flag 0 , , 1
Q9550@4.3GHz | 3D Mark 06 GTX 280 | 3D Mark 06 4870x2 | 3D Mark 06 5850
Asrock P67 Pro3|Intel Core i7 2600k|A-Data 2X2GB DDR3 @ 1866MHz 8-8-8-24|Sapphire 6850|WD Caviar Black 750GB Sata III 64MB|Coolermaster RealPower M700|Coolermaster HAF 922|Samsung SM P2350|A4Tech X755FS|Logitech Wave Keyboard
-
9th April 2010 09:59 #3
!
- . , 2. !
3- !
---------- 09:59 ---------- 09:49 ----------
... , , .
))
-
9th April 2010 10:08 #4
J//
if (a[i][j] == cifra)
{
flag = 1;
break;
}
proizv=1.
, . :
//
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{
cout << "Vyvedete [" << i << ", " << j << "]:";
cin >> a[i][j];
}
cout << "Vyvedete cifra za tyrsene:";
cin >> cifra;
define MAXN = 6 ( ) n -
A : , for(int j=i; j<n; j++) .: XaMaB; . 0.42
In God we Trust (all others must submit a X.509 certificate). , ()
-
9th April 2010 14:55 #5
!
---------- 10:57 ---------- 10:44 ----------
, , - , - , . .
---------- 11:22 ---------- 10:57 ----------
3 !!! 3 !!!
---------- 14:55 ---------- 11:22 ----------
, !!! .
Dev C++ 
...Last edited by jonyshub; 9th April 2010 at 11:07.
-
9th April 2010 16:39 #6
.
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in