Python3.5 Language Examples:
#coding = Utf-8ImportSYSdefsub_string (b): C=[0]*Len (b) forIinchRange (len (a)): forJinchRange (len (b)):ifSTR (a[i]). Find (str (B[J)))!=-1: C[j]= C[j] + 1 forKinchC:Print(k)if __name__=='__main__': N=Int (Sys.stdin.readline (). Strip ()) a=list () b=list () forIinchRange (N): A.append (Input ()) M=Int (Sys.stdin.readline (). Strip ()) forIinchRange (M): B.append (Input ()) sub_string (A, b)
python2.7 instances:
#!/usr/bin/env python#Coding=utf-8#Python uses 2.7, indents can use tab, 4 spaces, or 2 spaces, but only one can be selected, not a variety of mixing while1: A=[] s=raw_input ()#raw_input () do not have any information ifs! ="": forXinchs.split (): a.append (int (x))Printsum (a)Else: Break
C Language Examples:
#include <stdio.h>int main () { int A, b; while (scanf ("%d%d", &a, &b)! = EOF) printf ("%d \ n", A + b);}
C + + Language instance:
#include usingnamespace std; int Main () { int A, b; while (Cin>> a >> b) << A + b << Endl; return 0 ;}
Java language instance:
//Package Main//be careful not to add the package name, or you will get an error. ImportJava.io.*;ImportJava.util.*;classTest {} Public classmain{ Public Static voidMain (String args[]) {Scanner cin=NewScanner (system.in); intA, B; while(Cin.hasnextint ()) {a=Cin.nextint (); b=Cin.nextint (); System.out.println (A+b); } }}
Three major language examples (Python,c/c++,java)