From 006939577effb5372d8638bba5cbb0a1a230ef41 Mon Sep 17 00:00:00 2001 From: lxh <1252382684@qq.com> Date: Thu, 6 Aug 2020 21:06:44 +0800 Subject: [PATCH] ex.txt --- ex.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ex.txt diff --git a/ex.txt b/ex.txt new file mode 100644 index 0000000..ff03e5b --- /dev/null +++ b/ex.txt @@ -0,0 +1,21 @@ +package jisuanqi; + +import java.util.Scanner; + +public class ex { + + public static void main(String[] args) { + // TODO Auto-generated method stub + double e=Math.E; + double x,result; + Scanner sc=new Scanner(System.in); + while(true) + { + System.out.println("请输入x的值"); + x=sc.nextInt(); + result=Math.pow(e,x); + System.out.println("result="+result); + } + + } +}