Results 1 to 9 of 9

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Sep:2004
    Posts: 74

    . , . . , . while . .

  2. #2
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    Code:
    int aa = 0;
    while(something) {
    //some code
    if (aa%2) {//   C %   ...
       //some other code
       }
    aa++;
    
    }
    ? for .
    ..

  3. #3
    Registered User
    Join Date: Sep:2004
    Posts: 74
    , .
    Code:
    int i=1, br=0, s=0; 
    while (i<=10)
      {   
          br++;
          if (br%2) 
          {
            s+=i;
            i++;      
          }   
      }
    : , , .
    100% , .

  4. #4
    Darknauss's Avatar
    Join Date: Mar:2005
    Location: Sofia/Vienna
    Posts: 2,151
    (br % 2 = 1) ?

    s+=i ?
    Last edited by Darknauss; 31st March 2009 at 06:58.

  5. #5
    Registered User
    Join Date: Sep:2004
    Posts: 74
    ==1 !=0 , s+=i . - :
    Code:
    int br=0;
    while (something)
    {
      br++;
      if (br%2==1)
      {
        expression
      }
    }
    , .

  6. #6
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , A B, , ?
    , . :

    Code:
    struct CharIdx {
        char c;
        int i;
    };
    ...
    // s   
    // t    CharIdx-
    for (i = 0; i < strlen(s); i++) {
        t[i].c = s[i];
        t[i].i = i;
    }
    ...

    Code:
    while (something) {
      br++;
      if (t[br].i % 2 == 1) { expression }
    }
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  7. #7
    Registered User mln's Avatar
    Join Date: Jul:2006
    Location: Varna
    Posts: 100
    ( ), . . "" "".

    Code:
    vector<string> parse(string s, string substr)
    {
    	vector<string> ret;
    	for(int p1 = 0, p2; p1 < s.size(); p1 = p2 + 1)
    	{
    		p2 = s.find(substr,p1);
    		if(p2 == -1) p2 = s.size();
    		iret.push_back(s.substr(p1,p2-p1));
    	}
    	return ret;
    }
    
    string str = "Vendors selected for the Cool Vendor report are innovative, impactful and intriguing";
    
    int main()
    {
    	vector<string> parts = parse(str, "e");
    	string ret = "";
    	for(int i = 0; i < parts.size(); i++)
    	{
    		if(i) ret += i % 2 ? "e" : "EEE";
    		ret += parts[i];
    	}
    	cout<<ret;
    	return 0;
    }
    |Aus Z87-Pro, 4770k, 2x8GB GEIL EVO LEGGERA 1866, 2x PowerColor PCS+ 290, OCZ Vertex Le 100gb + 2xWD640 AAKS, EVGA Supernova P2 1000W, 24" Dell 2408WFP

  8. #8
    a.k.a. Bibi Flower's Avatar
    Join Date: Aug:2006
    Location: Sofia, Bulgaria
    Posts: 562
    ? 1 , ...


    i++;
    if

  9. #9
    Registered User
    Join Date: Sep:2004
    Posts: 74
    !!! , .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |