Results 1 to 4 of 4

Thread: C

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Powered by Intel & AMD PiToMeN's Avatar
    Join Date: Dec:2005
    Location:
    Posts: 24

    C

    , C , ...



    :
    Code:
    ...
    
    int p,s,n;
    
    p=0;
    s=0;
    printf("Vuvedete stoinost za p= \n");
    scanf("%d", &p);
    
    for(p=0; p<n; p++)
    { if (w[p]/10!=0)
    {s+=w[p]%10;
    w[p]=w[p]/10;
    printf("Vuvedete nova stoinost za p= \n");
    scanf("%d", &p);
    }
    else
    w[p]=s;
    p++;
    
    }
    , "do-while" while , .

    !

  2. #2
    Registered User
    Join Date: Dec:2007
    Location: Sofia
    Posts: 366

    1. while do-while?
    2. ?

    , printf/scanf, p?

  3. #3
    Powered by Intel & AMD PiToMeN's Avatar
    Join Date: Dec:2005
    Location:
    Posts: 24
    .

    Code:
    #include "stdafx.h"
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	int p, s, n;
    	int w[256];
    	p=0;
    	s=0;
    	printf("Vuvedi n: \n"); //maksimalnoto za p
    	scanf("%d", &n);
    	printf("Vuvedi p: \n");
    	scanf("%d", &p);
    	
    	while(p<n)
    	{
    	do {
    		s+=w[p]%10;
    		w[p]=w[p]/10;
    	} while(w[p]/10!=0);
    	w[p]=s;
    	p=p+1; // p++
    	}
    	return 0;
    }

  4. #4
    Registered User
    Join Date: Dec:2007
    Location: Sofia
    Posts: 366


    while do-while . , s , .

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 |