Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.lab1
- import androidx.appcompat.app.AppCompatActivity
- import android.os.Bundle
- import android.widget.TextView
- class MainActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- var textView: TextView
- val result: TextView
- val x=3
- textView = findViewById(R.id.textView)
- result = findViewById(R.id.result)
- textView.text = x.toString()
- while(n<8)
- {
- val a=a*(x-2.pow(n))
- val b=b*(x-(2.pow(n)-1))
- val n=n+1
- }
- val res=a/b
- result.text = res.toString()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment