سم الله الرحمن الرحيم
انا لدي كود لخوارزمية ايجاد المجموعات الجزئية الشهيره واريد تحويلها الى مخطط انسيابي الرجاء من الاعضاء من لدية العلم أن بكيفية تحويل الكود الى مخطط انسيابي يعني بشكل خوارزمية ان يساعدني وهذا الكود تبع الخوارزمية وجزاكم الله الف خيرا
#include <iostream.h>
int Fact(int x)
{
int r =1;
for(int q=1;q<x;q++)
r=r*q;
return r;
}
int T(int x,int y)
{
return (Fact(x)/(Fact(x-y)*Fact(y)));
}
void main()
{
const int char_num=5;
const int STR = 3;
char STRING[char_num]={'1','2','3','4','5'};
int pos[STR+1];int count[STR+1];
int POW;
for(int e=0;e<STR+1;e+)
{
count[e]=0;
pos[e]=e;
}
for(int q=0;q<T(char_num;STR);q++)
{
for(int w=0;w<STR;w++)
{
POW= T(char_num-pos[w]-1,STR-w-1);
if(count[w]%POW==0)
{
pos[w]++;
count[w+1]=0;
count[w]=0;
pos[w+1]=pos[w];
}
count[w]++;
cout<<STRING[pos[w]];
}
cout <<endl;
}
cin.get();
//End main
}