Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import(
- "fmt"
- "os"
- "text/scanner"
- "strconv"
- )
- var sc scanner.Scanner
- func nextInt() int {
- sc.Scan()
- i, _ := strconv.Atoi(sc.TokenText())
- return i
- }
- func main(){
- sc.Init(os.Stdin)
- x := nextInt()
- y := nextInt()
- row := make([]int, x)
- for i := 0; i< y; i++{
- for j := 0 ; j < x; j++{
- tmp := nextInt()
- if tmp == 1{
- row[j] += 1
- }
- }
- }
- for i := 0; i< y; i++{
- for j := 0 ; j < x; j++{
- if row[j] > y - i - 1{
- fmt.Print(1)
- }else{
- fmt.Print(0)
- }
- if j < x - 1{
- fmt.Print(" ")
- }
- }
- fmt.Println()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement