Annotation of 43BSDReno/usr.bin/learn/learnlib/C/L35.1a, revision 1.1.1.1

1.1       root        1: #print
                      2: Write a program which prints the number of vowels
                      3: (instances of 'a', 'e', 'i', 'o', and 'u')
                      4: in the input.
                      5: #once #create Ref
                      6: hoboken harrison newark roseville avenue grove street
                      7: east orange brick church orange highland avenue
                      8: mountain station south orange maplewood millburn short hills
                      9: summit chatham madison convent station morristown
                     10: new providence murray hill berkeley heights
                     11: gillette stirling millington lyons basking ridge
                     12: bernardsville far hills peapack gladstone
                     13: #user
                     14: a.out <Ref >xxx
                     15: grep 109 xxx >/dev/null
                     16: #succeed
                     17: /*  a possible solution */
                     18:  #include <stdio.h>
                     19: 
                     20: main()
                     21: {
                     22:        int k, c;
                     23: 
                     24:        k = 0;
                     25:        while ((c = getchar()) != EOF)
                     26:                switch (c) {
                     27:                case 'a': case 'e':case 'i': case 'o': case 'u':
                     28:                        k++;
                     29:                        break;
                     30:                }
                     31:        printf("%d\n", k);
                     32: }
                     33: #log
                     34: #next
                     35: 37.1a 10

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.