Re-word: He like many others does not trust exectuables presented to them from foreign, unknown sources on a programming website.

More likely to be me, rather than you lol.

@OP
Agreed, post the source....or nobody will look at it.

#include <iostream>
#include <conio.h>
#include <windows.h>
#include <string.h>
using namespace std;

void schedule(int,int []);
int main()
{
    int n,f[20],i;


       
    cout<<"enter the number of teams:"<<endl;
    cin>>n;
  
    cout<<"enter the name of the teams:"<<endl;
    for(i=0;i<n;i++)
    cin>>f[i];
    if(n%2!=0)
    {f[i]=0;
    n=n+1;}   //0 is a dummy team

    schedule(n,f);

    return 0;
}
void schedule(int n,int f[20])
{int *t,l,x;

for(int i=0;i<n-1;i++)
{
t=&f[n-1];
 cout<<"\n\n\n\n\n\n"<<"            Week "<<i+1<<endl;
    for(int j=0;j<n/2;j++)
    {

        cout<<"         "<<f[j]<<"         "<<*t<<endl;
        t--;

        }
        x=f[n-1];
        for(l=n-1;l>1;l--)
        f[l]=f[l-1];
        f[l]=x;





    }
    }

Is there a way to rewrite this code using divide and conquer method?

This article has been dead for over six months. Start a new discussion instead.