German Nouns

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

German is a hard language. Since everyone struggles with it, you are tasked to write a program to count the number of nouns in a line of German to make students learn faster.

Input Specification

The input will start with one line, N, that describes how many lines of German you will need to process. We are sane people here, so it's not going to be over 100 lines. You will need to find the number of nouns in the next N lines. The lines will all follow standard German capitalization, and the first word will only be capitalized if it is a noun, to make your life easier. The German will be converted to ASCII only with standard rules, e.g. ä → ae, Ü → Ue, ß = ss. There will be no abbreviations and the like. Also to save you trouble, no pronouns will be capitalized.

Output Specification

You are to print a number A, the amount of nouns in the line, for each line processed.

Sample Input

5
wenn die Nacht kommt
wird die Sehnsucht klarer.
alle Traeume sind im Dunkeln wahrer.
frei von Aengsten steigen
Gefuehle aus dem Schweigen.

Sample Output

1
1
2
1
2

Comments


  • 1
    Kiki_Delfin  commented on Jan. 11, 2024, 6:14 p.m.

    I'm German. These sentences are called: when night comes the longing becomes clearer. all dreams are truer in the dark. rise free of fears Feelings from silence.


    • 2
      b_nary  commented on Jan. 12, 2024, 1:03 a.m.

      German is a pretty cool name


  • 1
    Kiki_Delfin  commented on Dec. 14, 2023, 7:46 p.m.

    I'm German. :)


    • 0
      thomas_li  commented on Dec. 15, 2023, 5:24 p.m.

      Hi German


  • 1
    HS  commented on Oct. 19, 2018, 10:25 a.m.

    There's one test case...


  • 1
    alpturkmen  commented on Feb. 20, 2015, 2:39 a.m.

    Am i missing something or does this problem not outline how to distinguish a german noun from other german words?


    • 4
      Xyene  commented on Feb. 20, 2015, 2:55 a.m.

      You are missing something. Re-read the problem, and examine the sample carefully.


      • 2
        alpturkmen  commented on Feb. 20, 2015, 2:07 p.m.

        My bad, sorry.