Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int n,a[100][100];
- int viz [1000],n,conexe;
- int cuata()
- {
- int i;
- for (i=1;i<=n;i++)
- if (viz[i]==0)
- return i;
- return =1;
- }
- int bf(int x)
- {
- //parcurgerea in latime
- }
- void citire()
- {
- //...
- }
- int nr_comp()
- {
- int x;
- do
- {
- x=cauta();
- if (x!=-1)
- {
- conexe+1;
- bf(x);
- }
- }while (x!=-1);
- return conexe;
- }
- int main()
- {
- citire();
- cout<<nr_comp();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement