[C++] Numeracja

0

Mam mały problem z numeracja.
Chodzi o to że za łączony program powinen tworzyć pod foldery.
gdy wpisze liczbę 2 i nazwę programy powinno utworzyć foldery o nazwie
programy-0000000-0000099
programy-0000100-0000199
gdy wpisze 11 to
programy-0000000-0000099
programy-0000100-0000199
...
programy-0001000-0001099
programy-0001100-0001199
resztę programu już mam brakuje mi tylko tej numeracji

 #include <windows.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int iFolderCount;
    char name[20];
    std::string sMainPath = "NE100-Rotterdam OPS-IRT\\";

    CreateDirectory(sMainPath.c_str(), NULL);
    cout << "How many you need a subfolders:\n";
    cin >> iFolderCount;
    cout << "Give a Name a subfolders:\n";
    cin >> name;
    for (int i=0; i<=iFolderCount; ++i)
    {         
              cout << "\n Creating ";
              cout << i;
              cout << ": Folder\n";
        std::ostringstream ss;
        ss << i; 
        std::ostringstream named;
        named << name; 
        std::string sFolderName = named.str()+"-"+ ss.str() + "00-" +ss.str() + "99\\" ;
                
        CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
        for (int l=0; l<=99; ++l)
        {
        std::ostringstream ll;
        ll << l;
        if(l<10)
        {
        CreateDirectory((sMainPath+sFolderName+named.str()+"-"+ss.str()+"0"+ll.str()).c_str(), NULL);
                           std::string subFolderName =named.str()+"-"+ss.str()+"0"+ll.str()+"\\";
                           CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
        
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence IN\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence OUT\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Fieldreport\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Internal\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Raport\\").c_str(), NULL);
        }
        else
        {
                 CreateDirectory((sMainPath+sFolderName+named.str()+"-"+ss.str()+ll.str()).c_str(), NULL);
         std::string subFolderName =named.str()+"-"+ss.str()+ll.str()+"\\";
        CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
        
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence IN\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence OUT\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Fieldreport\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Internal\\").c_str(), NULL);
        CreateDirectory((sMainPath+sFolderName+subFolderName+"Raport\\").c_str(), NULL);
        }   
        }

    }
    cout << "\n\n I Made ";
    cout << iFolderCount;
    cout << " Folders \n\n";
    
    system("PAUSE");
    return EXIT_SUCCESS;
}
0

może być C?

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char**argv)
{
	unsigned int ile ;
	char s[25] ;
	unsigned int i;
	
	
	printf("daj liczbe: ") ;
	scanf("%u",&ile) ;
	
	for (i=0;i<ile;++i)
	{
		sprintf(s,"programy-%05u00-%05u99",i,i) ;
		printf("%s\n",s) ;
	}
	
	return 0 ;
}
0

Wchodzi o ciąg cyfrowy rozrysowałem to mniej więcej.
http://img526.imageshack.us/i/affw.jpg/
nie jestem artystą ;p

myślałem że zrobie to Switch, ale jednak pomysł jest głupi nie da sie chyba poprzeczki wartości uzyć np. od np. 10-99 i od 100-999

0

teraz to ja już nie wiem o co w tym chodzi :D daj treść zadania, czy coś

1 użytkowników online, w tym zalogowanych: 0, gości: 1