Results 1 to 9 of 9

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User ak101's Avatar
    Join Date: Oct:2004
    Location: 359/02
    Posts: 10,957

    " "


    Code:
    #include <stdio.h>
    #define IN 1
    #define OUT 0
    
    main()
    {
    	int c, nl, nw, nc, state;
    
    	state=OUT;
    	nl=nw=nc=0;
    	while ((c=getchar()) !=EOF){
    		++nc;
    		if (c == ' ' || c == '\n' || c = '\t')
    			state = OUT;
    		else if (state==OUT) {
    			state = IN;
    		}
    	}
    	printf("%d %d %d\n", nl, nw, nc);
    }
    13 .
    13 C:\Dev-Cpp\Untitled1.c invalid lvalue in assignment

    ?
    " fear of weapons is a sign of retarded sexual and emotional maturity" S. Freud

  2. #2
    breaknenter's Avatar
    Join Date: May:2007
    Location:
    Posts: 5,942
    c = '\t' ?

  3. #3
    Registered User ak101's Avatar
    Join Date: Oct:2004
    Location: 359/02
    Posts: 10,957
    .

    , , , ?
    " fear of weapons is a sign of retarded sexual and emotional maturity" S. Freud

  4. #4
    Registered User
    Join Date: Aug:2006
    Location:
    Posts: 4,052
    Ctrl+Z ?

  5. #5
    Registered User ak101's Avatar
    Join Date: Oct:2004
    Location: 359/02
    Posts: 10,957
    . .
    " fear of weapons is a sign of retarded sexual and emotional maturity" S. Freud

  6. #6
    Registered User cecko19's Avatar
    Join Date: Jan:2011
    Location: Sofia
    Posts: 82
    ...

  7. #7
    Registered User
    Join Date: Jan:2005
    Location: BG
    Posts: 4,903
    , , e ?
    getchar(); , .

    .. . nl nw ++ ??? .
    , , ... ...

  8. #8
    Registered User ak101's Avatar
    Join Date: Oct:2004
    Location: 359/02
    Posts: 10,957
    Quote Originally Posted by flancer View Post
    , , e ?
    getchar(); , .

    .. . nl nw ++ ??? .

    , , .

    , 3 Ctrl+Z nl, nw, nc .

    ,
    Last edited by ak101; 29th April 2011 at 19:25.
    " fear of weapons is a sign of retarded sexual and emotional maturity" S. Freud

  9. #9
    Registered User
    Join Date: Jan:2005
    Location: BG
    Posts: 4,903
    , ++ , :

    #include <stdio.h>
    #define IN 1
    #define OUT 0

    main()
    {
    int c, nl, nw, nc, state;

    state=OUT;
    nl=nw=nc=0;
    while ((c=getchar())!=EOF)
    {
    ++nc;
    if (c == ' ' || c == '\n' || c == '\t')
    {state = OUT;
    ++nw;
    }
    else if (state==OUT)
    {state = IN;
    ++nl;
    }

    }
    printf("%d %d %d\n", nl, nw, nc);
    getchar();
    }

    - . + , . ... ...

    .. ? ... , ... , ...
    , , ... ...

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 |